summaryrefslogtreecommitdiff
path: root/digital
diff options
context:
space:
mode:
Diffstat (limited to 'digital')
-rw-r--r--digital/ucoolib/build/stm32f4.mk9
-rw-r--r--digital/ucoolib/build/top.mk5
2 files changed, 14 insertions, 0 deletions
diff --git a/digital/ucoolib/build/stm32f4.mk b/digital/ucoolib/build/stm32f4.mk
index ae899b53..71ffcbdd 100644
--- a/digital/ucoolib/build/stm32f4.mk
+++ b/digital/ucoolib/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/digital/ucoolib/build/top.mk b/digital/ucoolib/build/top.mk
index 71fe1be0..d4f53fe4 100644
--- a/digital/ucoolib/build/top.mk
+++ b/digital/ucoolib/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