diff options
author | Karl Palsson <karlp@tweak.net.au> | 2019-05-22 15:09:35 +0300 |
---|---|---|
committer | Karl Palsson <karlp@tweak.net.au> | 2019-05-22 15:09:35 +0300 |
commit | 96d094af13dab67709a252a39da164bde4d637e0 (patch) | |
tree | 1411ec6494797cd227466768daab4d6607281855 | |
parent | 58536780036b9e5bb618da63fc5f7a07261cc207 (diff) |
mk/genlink-config: provide LIBNAME in devices autogeneration
This makes the generic rules workk happily regardless of whether the
linkerscript generation is being used or not.
Notably, in the examples repo, use of the linker script autogeneration
was retriggering library builds as LIBNAME was unset and therefore the
libraries lib<blank>.a couldn't be found.
-rw-r--r-- | mk/genlink-config.mk | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mk/genlink-config.mk b/mk/genlink-config.mk index 6935ec9b..d2970b4c 100644 --- a/mk/genlink-config.mk +++ b/mk/genlink-config.mk @@ -55,17 +55,18 @@ endif # only append to LDFLAGS if the library file exists to not break builds # 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 +LIBNAME = opencm3_$(genlink_family) else ifneq (,$(wildcard $(OPENCM3_DIR)/lib/libopencm3_$(genlink_subfamily).a)) -LDLIBS += -lopencm3_$(genlink_subfamily) -LIBDEPS += $(OPENCM3_DIR)/lib/libopencm3_$(genlink_subfamily).a +LIBNAME = opencm3_$(genlink_subfamily) else $(warning $(OPENCM3_DIR)/lib/libopencm3_$(genlink_family).a library variant for the selected device does not exist.) endif endif +LDLIBS += -l$(LIBNAME) +LIBDEPS += $(OPENCM3_DIR)/lib/lib$(LIBNAME) + # only append to LDLIBS if the directory exists ifneq (,$(wildcard $(OPENCM3_DIR)/lib)) LDFLAGS += -L$(OPENCM3_DIR)/lib |