summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorNicolas Schodet2012-12-15 22:17:58 +0100
committerNicolas Schodet2019-10-06 23:29:59 +0200
commit2e4219da9aa3d3a5f68a7aa7966f8d460692692b (patch)
treedf0bd4002b7517fab498dd0b14a992a1e8d0bb8e /build
parent88981189707bf102d61b6fd3e0f8eac8560cf533 (diff)
build: add program target
Diffstat (limited to 'build')
-rw-r--r--build/stm32f4.mk9
-rw-r--r--build/top.mk5
2 files changed, 14 insertions, 0 deletions
diff --git a/build/stm32f4.mk b/build/stm32f4.mk
index ae899b5..71ffcbd 100644
--- a/build/stm32f4.mk
+++ b/build/stm32f4.mk
@@ -42,3 +42,12 @@ $(eval $(call arch_lst_rules,stm32f4))
$(eval $(call arch_bin_rules,stm32f4))
$(eval $(call arch_size_rules,stm32f4))
$(eval $(call arch_misc_rules,stm32f4))
+
+.PHONY: program.stm32f4
+ifeq ($(words $(stm32f4_PROGS)),1)
+program.stm32f4: $(stm32f4_PROGS:%=%.stm32f4.program)
+endif
+
+%.stm32f4.program: %.stm32f4.bin
+ @echo "PROG [stm32f4] $<"
+ $Qst-flash write $< 0x8000000
diff --git a/build/top.mk b/build/top.mk
index 71fe1be..d4f53fe 100644
--- a/build/top.mk
+++ b/build/top.mk
@@ -66,3 +66,8 @@ $(foreach target,$(TARGETS),$(eval $(call TARGETS_template,$(target))))
TARGETS_SUBTARGETS := $(foreach target,$(TARGETS),$(target):$(target) \
$(foreach subtarget,$($(target)_SUBTARGETS),$(target):$(subtarget)))
+
+.PHONY: program
+ifeq ($(words $(filter-out host,$(TARGETS))),1)
+program: $(patsubst %,program.%,$(filter-out host,$(TARGETS)))
+endif