Skip to content

Commit c998e9c

Browse files
authored
Merge pull request hathach#2069 from hathach/minor-build-system
Minor build system
2 parents 6ecd480 + 9f0bae4 commit c998e9c

File tree

17 files changed

+258
-280
lines changed

17 files changed

+258
-280
lines changed

.idea/vcs.xml

Lines changed: 0 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/make.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# Common make definition for all examples
33
# ---------------------------------------
44

5+
TOOLCHAIN ?= gcc
6+
57
#-------------- TOP and CURRENT_PATH ------------
68

79
# Set TOP to be the path to get from the current directory (where make was
@@ -75,6 +77,7 @@ else
7577
endif
7678

7779
#-------------- Cross Compiler ------------
80+
7881
# Can be set by board, default to ARM GCC
7982
CROSS_COMPILE ?= arm-none-eabi-
8083

examples/rules.mk

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,19 @@ endif
227227
# Jlink Interface
228228
JLINK_IF ?= swd
229229

230+
# Jlink script
231+
define jlink_script
232+
halt
233+
loadfile $^
234+
r
235+
go
236+
exit
237+
endef
238+
export jlink_script
239+
230240
# Flash using jlink
231241
flash-jlink: $(BUILD)/$(PROJECT).hex
232-
@echo halt > $(BUILD)/$(BOARD).jlink
233-
@echo r >> $(BUILD)/$(BOARD).jlink
234-
@echo loadfile $^ >> $(BUILD)/$(BOARD).jlink
235-
@echo r >> $(BUILD)/$(BOARD).jlink
236-
@echo go >> $(BUILD)/$(BOARD).jlink
237-
@echo exit >> $(BUILD)/$(BOARD).jlink
242+
@echo "$$jlink_script" > $(BUILD)/$(BOARD).jlink
238243
$(JLINKEXE) -device $(JLINK_DEVICE) -if $(JLINK_IF) -JTAGConf -1,-1 -speed auto -CommandFile $(BUILD)/$(BOARD).jlink
239244

240245
# Flash STM32 MCU using stlink with STM32 Cube Programmer CLI

0 commit comments

Comments
 (0)