Browse Source

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.
pull/1053/head
Karl Palsson 6 years ago
parent
commit
96d094af13
  1. 9
      mk/genlink-config.mk

9
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

Loading…
Cancel
Save