Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/thirdpin/libopencm3.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorChristian Tacke <Christian.Tacke+libopencm3@cosmokey.com>2018-02-26 22:43:00 +0300
committerKarl Palsson <karlp@tweak.net.au>2018-08-17 03:15:01 +0300
commitd14033c744b11d86069d9e71ab60eeb407faec61 (patch)
treed70b2291abc1f0c821670b0ecd6ac4627e02f951 /mk
parentf4bbe7c5bb39086a748810e83220e4e5a336bf50 (diff)
genlink: provide LIBDEPS for libopencm3 itself
If $(OPENCM3_DIR)/lib/libopencm3_*.a exists, it will be linked in. If we do that, we should also add it to the deps. That way a newer *.a will result in a relink. To use this, you should add a dependency to $(LIBDEPS) where you are using $(LDFLAGS) and $(LDLIBS) now. eg, old (wouldn't relink if the library changed) $(PROJECT).elf: $(OBJS) $(LDSCRIPT) @printf " LD\t$@\n" $(Q)$(LD) $(TGT_LDFLAGS) $(LDFLAGS) $(OBJS) $(LDLIBS) -o $@ new (will relink when the library changes) $(PROJECT).elf: $(OBJS) $(LDSCRIPT) $(LIBDEPS) @printf " LD\t$@\n" $(Q)$(LD) $(TGT_LDFLAGS) $(LDFLAGS) $(OBJS) $(LDLIBS) -o $@ Tested-by: Karl Palsson <karlp@tweak.net.au> Originally tracked via: https://github.com/libopencm3/libopencm3/pull/887
Diffstat (limited to 'mk')
-rw-r--r--mk/genlink-config.mk2
1 files changed, 2 insertions, 0 deletions
diff --git a/mk/genlink-config.mk b/mk/genlink-config.mk
index b2dfb3c6..6935ec9b 100644
--- a/mk/genlink-config.mk
+++ b/mk/genlink-config.mk
@@ -56,9 +56,11 @@ endif
# where those are provided by different means
ifneq (,$(wildcard $(OPENCM3_DIR)/lib/libopencm3_$(genlink_family).a))
LDLIBS += -lopencm3_$(genlink_family)
+LIBDEPS += $(OPENCM3_DIR)/lib/libopencm3_$(genlink_family).a
else
ifneq (,$(wildcard $(OPENCM3_DIR)/lib/libopencm3_$(genlink_subfamily).a))
LDLIBS += -lopencm3_$(genlink_subfamily)
+LIBDEPS += $(OPENCM3_DIR)/lib/libopencm3_$(genlink_subfamily).a
else
$(warning $(OPENCM3_DIR)/lib/libopencm3_$(genlink_family).a library variant for the selected device does not exist.)
endif