Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 1 | # ---------------------------------------------------------------------------- |
| 2 | # ATMEL Microcontroller Software Support |
| 3 | # ---------------------------------------------------------------------------- |
| 4 | # Copyright (c) 2010, Atmel Corporation |
| 5 | # |
| 6 | # All rights reserved. |
| 7 | # |
| 8 | # Redistribution and use in source and binary forms, with or without |
| 9 | # modification, are permitted provided that the following conditions are met: |
| 10 | # |
| 11 | # - Redistributions of source code must retain the above copyright notice, |
| 12 | # this list of conditions and the disclaimer below. |
| 13 | # |
| 14 | # Atmel's name may not be used to endorse or promote products derived from |
| 15 | # this software without specific prior written permission. |
| 16 | # |
| 17 | # DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR |
| 18 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 19 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE |
| 20 | # DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 21 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 22 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, |
| 23 | # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
| 24 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 25 | # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, |
| 26 | # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | # ---------------------------------------------------------------------------- |
| 28 | |
| 29 | # Makefile for compiling the Getting Started with SAM3S Microcontrollers project |
| 30 | |
Oliver Smith | 09c3d45 | 2021-03-05 11:32:45 +0100 | [diff] [blame] | 31 | GIT_VERSION=$(shell $(TOP)/git-version-gen $(TOP)/.tarball-version) |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 32 | #------------------------------------------------------------------------------- |
| 33 | # User-modifiable options |
| 34 | #------------------------------------------------------------------------------- |
| 35 | |
| 36 | # Chip & board used for compilation |
| 37 | # (can be overriden by adding CHIP=chip and BOARD=board to the command-line) |
Harald Welte | d8a003d | 2017-02-27 20:31:09 +0100 | [diff] [blame] | 38 | CHIP ?= sam3s4 |
| 39 | BOARD ?= qmod |
Harald Welte | 87940f1 | 2019-12-06 20:07:06 +0100 | [diff] [blame] | 40 | APP ?= dfu |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 41 | |
| 42 | # Defines which are the available memory targets for the SAM3S-EK board. |
Harald Welte | 87940f1 | 2019-12-06 20:07:06 +0100 | [diff] [blame] | 43 | ifeq ($(APP), dfu) |
Kévin Redon | b6e2f0f | 2019-12-11 17:04:21 +0100 | [diff] [blame] | 44 | MEMORIES ?= flash dfu |
Harald Welte | 87940f1 | 2019-12-06 20:07:06 +0100 | [diff] [blame] | 45 | else |
| 46 | MEMORIES ?= dfu |
| 47 | endif |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 48 | |
Kévin Redon | d14970f | 2019-08-01 17:17:18 +0200 | [diff] [blame] | 49 | # Output directories and filename |
| 50 | OUTPUT = $(BOARD)-$(APP) |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 51 | BIN = bin |
Harald Welte | d8a003d | 2017-02-27 20:31:09 +0100 | [diff] [blame] | 52 | OBJ = obj/$(BOARD) |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 53 | |
| 54 | #------------------------------------------------------------------------------- |
| 55 | # Tools |
| 56 | #------------------------------------------------------------------------------- |
| 57 | |
Harald Welte | 3f5e3dd | 2017-02-27 13:53:17 +0100 | [diff] [blame] | 58 | AT91LIB = ./atmel_softpack_libraries |
| 59 | |
| 60 | AT91LIB_USB_COMMON_CORE_PATH = $(AT91LIB)/usb/common/core |
| 61 | AT91LIB_USB_CORE_PATH = $(AT91LIB)/usb/device/core |
| 62 | AT91LIB_USB_DFU_PATH = $(AT91LIB)/usb/device/dfu |
Christina Quast | 9649361 | 2015-01-03 22:22:36 +0100 | [diff] [blame] | 63 | |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 64 | # Tool suffix when cross-compiling |
| 65 | CROSS_COMPILE = arm-none-eabi- |
| 66 | |
Harald Welte | d09829d | 2017-02-27 22:58:59 +0100 | [diff] [blame] | 67 | LIBS = -Wl,--start-group -lgcc -Wl,--end-group -nostdlib |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 68 | |
| 69 | # Compilation tools |
| 70 | CC = $(CROSS_COMPILE)gcc |
| 71 | LD = $(CROSS_COMPILE)ld |
| 72 | SIZE = $(CROSS_COMPILE)size |
| 73 | STRIP = $(CROSS_COMPILE)strip |
| 74 | OBJCOPY = $(CROSS_COMPILE)objcopy |
| 75 | GDB = $(CROSS_COMPILE)gdb |
| 76 | NM = $(CROSS_COMPILE)nm |
| 77 | |
Harald Welte | 2315e6b | 2016-03-19 21:37:55 +0100 | [diff] [blame] | 78 | TOP=.. |
Harald Welte | 2315e6b | 2016-03-19 21:37:55 +0100 | [diff] [blame] | 79 | |
Harald Welte | d09829d | 2017-02-27 22:58:59 +0100 | [diff] [blame] | 80 | #------------------------------------------------------------------------------- |
| 81 | # Files |
| 82 | #------------------------------------------------------------------------------- |
| 83 | |
| 84 | # Directories where source files can be found |
| 85 | |
| 86 | USB_PATHS = $(AT91LIB_USB_CORE_PATH) $(AT91LIB_USB_DFU_PATH) $(AT91LIB_USB_COMMON_CORE_PATH) |
| 87 | |
| 88 | VPATH += $(USB_PATHS) |
| 89 | VPATH += $(AT91LIB)/libchip_sam3s/source/ $(AT91LIB)/libchip_sam3s/cmsis |
| 90 | VPATH += libboard/common/source libboard/$(BOARD)/source |
| 91 | VPATH += libcommon/source |
Harald Welte | 37b6e41 | 2017-02-27 23:20:38 +0100 | [diff] [blame] | 92 | VPATH += libosmocore/source |
Harald Welte | d09829d | 2017-02-27 22:58:59 +0100 | [diff] [blame] | 93 | VPATH += apps/$(APP) |
| 94 | |
| 95 | # Objects built from C source files |
| 96 | C_OSMOCORE = $(notdir $(wildcard libosmocore/source/*.c)) |
| 97 | C_LIBCHIP = $(notdir $(wildcard $(AT91LIB)/libchip_sam3s/source/*.c) $(wildcard $(AT91LIB)/libchip_sam3s/cmsis/*.c)) |
| 98 | |
| 99 | C_LIBUSB = USBDescriptors.c USBRequests.c USBD.c USBDCallbacks.c USBDDriver.c USBDDriverCallbacks.c |
Harald Welte | 912b183 | 2017-03-06 09:28:13 +0100 | [diff] [blame] | 100 | C_LIBUSB_RT = dfu.c dfu_runtime.c |
Harald Welte | d09829d | 2017-02-27 22:58:59 +0100 | [diff] [blame] | 101 | C_LIBUSB_DFU = dfu.c dfu_desc.c dfu_driver.c |
Harald Welte | e3b2de4 | 2020-01-11 12:31:51 +0100 | [diff] [blame] | 102 | C_LIBCOMMON = string.c stdio.c fputs.c usb_buf.c ringbuffer.c pseudo_talloc.c host_communication.c \ |
Harald Welte | 1afb70a | 2020-08-05 11:59:26 +0200 | [diff] [blame] | 103 | main_common.c stack_check.c |
Harald Welte | d09829d | 2017-02-27 22:58:59 +0100 | [diff] [blame] | 104 | |
| 105 | C_BOARD = $(notdir $(wildcard libboard/common/source/*.c)) |
Kévin Redon | 72a62cf | 2019-02-07 17:42:29 +0100 | [diff] [blame] | 106 | C_BOARD += $(notdir $(wildcard libboard/$(BOARD)/source/*.c)) |
Harald Welte | d09829d | 2017-02-27 22:58:59 +0100 | [diff] [blame] | 107 | |
| 108 | C_APPLEVEL = $(notdir $(wildcard apps/$(APP)/*.c)) |
| 109 | |
| 110 | C_FILES = $(C_OSMOCORE) $(C_LIBCHIP) $(C_LIBUSB) $(C_LIBCOMMON) $(C_BOARD) $(C_APPLEVEL) |
| 111 | |
| 112 | -include apps/$(APP)/Makefile |
| 113 | |
| 114 | C_OBJECTS = $(C_FILES:%.c=%.o) |
| 115 | |
| 116 | # Trace level used for compilation |
| 117 | # (can be overriden by adding TRACE_LEVEL=#number to the command-line) |
| 118 | # TRACE_LEVEL_DEBUG 5 |
| 119 | # TRACE_LEVEL_INFO 4 |
| 120 | # TRACE_LEVEL_WARNING 3 |
| 121 | # TRACE_LEVEL_ERROR 2 |
| 122 | # TRACE_LEVEL_FATAL 1 |
| 123 | # TRACE_LEVEL_NO_TRACE 0 |
| 124 | TRACE_LEVEL ?= 4 |
| 125 | |
Kévin Redon | 6228d18 | 2019-05-23 17:33:45 +0200 | [diff] [blame] | 126 | # allow asserting the peer SAM3S ERASE signal to completely erase the flash |
| 127 | # only applicable for qmod board |
| 128 | ALLOW_PEER_ERASE?=0 |
| 129 | |
Harald Welte | d09829d | 2017-02-27 22:58:59 +0100 | [diff] [blame] | 130 | #CFLAGS+=-DUSB_NO_DEBUG=1 |
| 131 | |
| 132 | # Optimization level, put in comment for debugging |
Harald Welte | edf9c9d | 2017-02-27 23:24:22 +0100 | [diff] [blame] | 133 | OPTIMIZATION ?= -Os |
Harald Welte | d09829d | 2017-02-27 22:58:59 +0100 | [diff] [blame] | 134 | |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 135 | # Flags |
Harald Welte | 3f5e3dd | 2017-02-27 13:53:17 +0100 | [diff] [blame] | 136 | INCLUDES_USB = -I$(AT91LIB)/usb/include -I$(AT91LIB) |
Christina Quast | 9649361 | 2015-01-03 22:22:36 +0100 | [diff] [blame] | 137 | |
Harald Welte | 3f5e3dd | 2017-02-27 13:53:17 +0100 | [diff] [blame] | 138 | INCLUDES = $(INCLUDES_USB) |
| 139 | INCLUDES += -I$(AT91LIB)/libchip_sam3s -I$(AT91LIB)/libchip_sam3s/include |
| 140 | INCLUDES += -I$(AT91LIB)/libchip_sam3s/cmsis |
| 141 | INCLUDES += -Ilibboard/common/include -Ilibboard/$(BOARD)/include |
| 142 | INCLUDES += -Ilibcommon/include |
| 143 | INCLUDES += -Ilibosmocore/include |
Harald Welte | 3f5e3dd | 2017-02-27 13:53:17 +0100 | [diff] [blame] | 144 | INCLUDES += -Isrc_simtrace -Iinclude |
Harald Welte | 2363fa0 | 2017-03-05 10:16:25 +0100 | [diff] [blame] | 145 | INCLUDES += -Iapps/$(APP) |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 146 | |
Harald Welte | c394109 | 2018-08-26 09:53:13 +0200 | [diff] [blame] | 147 | CFLAGS += -Wall -Wchar-subscripts -Wcomment -Wimplicit-int -Wformat=2 |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 148 | CFLAGS += -Werror-implicit-function-declaration -Wmain -Wparentheses |
Christina Quast | 9649361 | 2015-01-03 22:22:36 +0100 | [diff] [blame] | 149 | CFLAGS += -Wsequence-point -Wreturn-type -Wswitch -Wtrigraphs #-Wunused |
Harald Welte | c35998e | 2017-11-28 20:47:23 +0100 | [diff] [blame] | 150 | CFLAGS += -Wuninitialized -Wunknown-pragmas -Wfloat-equal #-Wundef |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 151 | CFLAGS += -Wshadow -Wpointer-arith -Wbad-function-cast -Wwrite-strings |
Harald Welte | c35998e | 2017-11-28 20:47:23 +0100 | [diff] [blame] | 152 | CFLAGS += -Waggregate-return #-Wsign-compare |
Christina Quast | 9649361 | 2015-01-03 22:22:36 +0100 | [diff] [blame] | 153 | CFLAGS += -Wmissing-format-attribute -Wno-deprecated-declarations |
Christina Quast | 29c99b9 | 2015-04-07 20:13:44 +0200 | [diff] [blame] | 154 | CFLAGS += #-Wpacked |
Harald Welte | 9457bf7 | 2017-05-07 11:20:24 +0200 | [diff] [blame] | 155 | CFLAGS += -Wredundant-decls -Wnested-externs #-Winline -Wlong-long |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 156 | CFLAGS += -Wunreachable-code |
Harald Welte | 7abdb51 | 2016-03-03 17:48:32 +0100 | [diff] [blame] | 157 | #CFLAGS += -Wcast-align |
Harald Welte | f672e9d | 2016-02-29 14:08:12 +0100 | [diff] [blame] | 158 | #CFLAGS += -std=c11 |
Christina Quast | 87d141e | 2015-01-27 14:56:33 +0100 | [diff] [blame] | 159 | CFLAGS += -Wmissing-noreturn |
| 160 | #CFLAGS += -Wconversion |
Christina Quast | d20f26d | 2015-01-27 14:40:31 +0100 | [diff] [blame] | 161 | CFLAGS += -Wno-unused-but-set-variable -Wno-unused-variable |
Christina Quast | 87d141e | 2015-01-27 14:56:33 +0100 | [diff] [blame] | 162 | CFLAGS += -Wno-suggest-attribute=noreturn |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 163 | |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 164 | # -mlong-calls -Wall |
| 165 | #CFLAGS += -save-temps -fverbose-asm |
| 166 | #CFLAGS += -Wa,-a,-ad |
Eric Wild | 19cd3b0 | 2020-04-03 21:33:30 +0200 | [diff] [blame^] | 167 | CFLAGS += -D__ARM -fno-builtin |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 168 | CFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb # -mfix-cortex-m3-ldrd |
Kévin Redon | 6349036 | 2019-05-23 17:37:18 +0200 | [diff] [blame] | 169 | CFLAGS += -ffunction-sections -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -DTRACE_LEVEL=$(TRACE_LEVEL) -DALLOW_PEER_ERASE=$(ALLOW_PEER_ERASE) |
Harald Welte | adbe72a | 2017-03-02 23:16:01 +0100 | [diff] [blame] | 170 | CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" |
| 171 | CFLAGS += -DBOARD=\"$(BOARD)\" -DBOARD_$(BOARD) |
| 172 | CFLAGS += -DAPPLICATION=\"$(APP)\" -DAPPLICATION_$(APP) |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 173 | ASFLAGS = -mcpu=cortex-m3 -mthumb -Wall -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -D__ASSEMBLY__ |
Eric Wild | 19cd3b0 | 2020-04-03 21:33:30 +0200 | [diff] [blame^] | 174 | LDFLAGS = -mcpu=cortex-m3 -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=ResetException -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--print-memory-usage -Wl,--no-undefined $(LIB) |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 175 | #LD_OPTIONAL=-Wl,--print-gc-sections -Wl,--stats |
| 176 | |
Kévin Redon | d14970f | 2019-08-01 17:17:18 +0200 | [diff] [blame] | 177 | # Append BIN directories to output filename |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 178 | OUTPUT := $(BIN)/$(OUTPUT) |
| 179 | |
| 180 | #------------------------------------------------------------------------------- |
| 181 | # Rules |
| 182 | #------------------------------------------------------------------------------- |
| 183 | |
Harald Welte | 2363fa0 | 2017-03-05 10:16:25 +0100 | [diff] [blame] | 184 | all: apps/$(APP)/usb_strings_generated.h $(BIN) $(OBJ) $(MEMORIES) |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 185 | |
Harald Welte | caca0b1 | 2017-05-05 22:29:15 +0200 | [diff] [blame] | 186 | combined: $(OUTPUT)-combined.bin |
| 187 | |
| 188 | $(BIN)/$(BOARD)-dfu-flash-padded.bin: $(BIN)/$(BOARD)-dfu-flash.bin |
| 189 | dd if=/dev/zero bs=16384 count=1 of=$@ |
| 190 | dd if=$< conv=notrunc of=$@ |
| 191 | |
| 192 | $(OUTPUT)-combined.bin: $(BIN)/$(BOARD)-dfu-flash-padded.bin $(OUTPUT)-dfu.bin |
| 193 | cat $^ > $@ |
| 194 | |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 195 | $(BIN) $(OBJ): |
Harald Welte | ebe8b20 | 2018-06-29 21:43:42 +0200 | [diff] [blame] | 196 | mkdir -p $@ |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 197 | |
Harald Welte | 2363fa0 | 2017-03-05 10:16:25 +0100 | [diff] [blame] | 198 | usbstring/usbstring: usbstring/usbstring.c |
| 199 | gcc $^ -o $@ |
| 200 | |
Harald Welte | 36f888f | 2019-12-06 19:17:53 +0100 | [diff] [blame] | 201 | .PHONY: apps/$(APP)/usb_strings.txt.patched |
| 202 | apps/$(APP)/usb_strings.txt.patched: apps/$(APP)/usb_strings.txt |
| 203 | sed "s/PRODUCT_STRING/$(shell cat libboard/$(BOARD)/product_string.txt)/" $< > $@ |
| 204 | |
| 205 | apps/$(APP)/usb_strings_generated.h: apps/$(APP)/usb_strings.txt.patched usbstring/usbstring |
Harald Welte | 2363fa0 | 2017-03-05 10:16:25 +0100 | [diff] [blame] | 206 | cat $< | usbstring/usbstring > $@ |
| 207 | |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 208 | define RULES |
| 209 | C_OBJECTS_$(1) = $(addprefix $(OBJ)/$(1)_, $(C_OBJECTS)) |
| 210 | ASM_OBJECTS_$(1) = $(addprefix $(OBJ)/$(1)_, $(ASM_OBJECTS)) |
| 211 | |
| 212 | $(1): $$(ASM_OBJECTS_$(1)) $$(C_OBJECTS_$(1)) |
Harald Welte | d8a003d | 2017-02-27 20:31:09 +0100 | [diff] [blame] | 213 | @$(CC) $(LDFLAGS) $(LD_OPTIONAL) -T"libboard/common/resources/$(CHIP)/$$@.ld" -Wl,-Map,$(OUTPUT)-$$@.map -o $(OUTPUT)-$$@.elf $$^ $(LIBS) |
Christina Quast | b6f77d3 | 2015-04-07 20:36:23 +0200 | [diff] [blame] | 214 | @$(NM) $(OUTPUT)-$$@.elf >$(OUTPUT)-$$@.elf.txt |
| 215 | @$(OBJCOPY) -O binary $(OUTPUT)-$$@.elf $(OUTPUT)-$$@.bin |
| 216 | @$(SIZE) $$^ $(OUTPUT)-$$@.elf |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 217 | |
| 218 | $$(C_OBJECTS_$(1)): $(OBJ)/$(1)_%.o: %.c Makefile $(OBJ) $(BIN) |
Christina Quast | b6f77d3 | 2015-04-07 20:36:23 +0200 | [diff] [blame] | 219 | @echo [COMPILING $$<] |
Harald Welte | adbe72a | 2017-03-02 23:16:01 +0100 | [diff] [blame] | 220 | @$(CC) $(CFLAGS) -DENVIRONMENT_$(1) -DENVIRONMENT=\"$(1)\" -Wa,-ahlms=$(BIN)/$$*.lst -c -o $$@ $$< |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 221 | |
| 222 | $$(ASM_OBJECTS_$(1)): $(OBJ)/$(1)_%.o: %.S Makefile $(OBJ) $(BIN) |
| 223 | @echo [ASSEMBLING $$@] |
Harald Welte | adbe72a | 2017-03-02 23:16:01 +0100 | [diff] [blame] | 224 | @$(CC) $(ASFLAGS) -DENVIRONMENT_$(1) -DENVIRONMENT=\"$(1)\" -c -o $$@ $$< |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 225 | |
| 226 | debug_$(1): $(1) |
| 227 | $(GDB) -x "$(BOARD_LIB)/resources/gcc/$(BOARD)_$(1).gdb" -ex "reset" -readnow -se $(OUTPUT)-$(1).elf |
| 228 | endef |
| 229 | |
| 230 | $(foreach MEMORY, $(MEMORIES), $(eval $(call RULES,$(MEMORY)))) |
| 231 | |
| 232 | program: |
Christina Quast | 58c1ae3 | 2015-04-07 18:19:13 +0200 | [diff] [blame] | 233 | openocd -f openocd/openocd.cfg -c "init" -c "halt" -c "flash write_bank 0 ./bin/project-flash.bin 0" -c "reset" -c "shutdown" |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 234 | |
Christina Quast | 55cd873 | 2015-04-08 00:10:50 +0200 | [diff] [blame] | 235 | SERIAL ?= /dev/ttyUSB0 |
| 236 | log: |
Harald Welte | 0b7e5f3 | 2019-12-02 19:25:55 +0100 | [diff] [blame] | 237 | stty -F $(SERIAL) 921600 |
Christina Quast | c63da3f | 2015-04-13 22:09:50 +0200 | [diff] [blame] | 238 | lsof $(SERIAL) && echo "log is already opened" || ( sed -u "s/\r//" $(SERIAL) | ts ) |
Christina Quast | 55cd873 | 2015-04-08 00:10:50 +0200 | [diff] [blame] | 239 | |
Christina Quast | c8ae58b | 2014-11-28 11:02:16 +0100 | [diff] [blame] | 240 | clean: |
Harald Welte | 36f888f | 2019-12-06 19:17:53 +0100 | [diff] [blame] | 241 | -rm -f apps/$(APP)/usb_strings.txt.patched |
Harald Welte | 0380d74 | 2017-05-07 11:20:40 +0200 | [diff] [blame] | 242 | -rm -fR $(OBJ)/*.o $(BIN)/*.bin $(BIN)/*.elf $(BIN)/*.elf.txt $(BIN)/*.map $(BIN)/*.lst `find . -name \*.p` |
Harald Welte | f7f61cd | 2018-08-26 09:23:54 +0200 | [diff] [blame] | 243 | |
| 244 | install: |
| 245 | mkdir -p $(DESTDIR)/usr/share/simtrace2 |
| 246 | cp $(BIN)/*.bin $(BIN)/*.elf $(BIN)/*.elf.txt $(BIN)/*.map $(DESTDIR)/usr/share/simtrace2 |