diff --git a/Makefile.base b/Makefile.base index 6ca82a7d9f..45548c6538 100644 --- a/Makefile.base +++ b/Makefile.base @@ -52,6 +52,10 @@ ifeq ($(strip $(ASSMSRC))$(NO_AUTO_SRC),) ASSMSRC := $(wildcard *.S) endif +# include makefile snippets that modify GENSRC here: +#include foo/bar.inc.mk + +GENOBJC := $(GENSRC:%.c=%.o) OBJC_LTO := $(SRC:%.c=$(BINDIR)/$(MODULE)/%.o) OBJC_NOLTO := $(SRC_NOLTO:%.c=$(BINDIR)/$(MODULE)/%.o) OBJC := $(OBJC_NOLTO) $(OBJC_LTO) @@ -59,7 +63,7 @@ OBJCXX := $(SRCXX:%.cpp=$(BINDIR)/$(MODULE)/%.o) ASMOBJ := $(ASMSRC:%.s=$(BINDIR)/$(MODULE)/%.o) ASSMOBJ := $(ASSMSRC:%.S=$(BINDIR)/$(MODULE)/%.o) -OBJ := $(OBJC) $(OBJCXX) $(ASMOBJ) $(ASSMOBJ) +OBJ := $(OBJC) $(OBJCXX) $(ASMOBJ) $(ASSMOBJ) $(GENOBJC) DEP := $(OBJC:.o=.d) $(OBJCXX:.o=.d) $(ASSMOBJ:.o=.d) $(BINDIR)/$(MODULE)/: @@ -87,6 +91,12 @@ $(OBJC): $(BINDIR)/$(MODULE)/%.o: %.c $(RIOTBUILD_CONFIG_HEADER_C) -DRIOT_FILE_NOPATH=\"$(notdir $<)\" \ $(CFLAGS) $(INCLUDES) -MD -MP -c -o $@ $(abspath $<) +$(GENOBJC): %.o: %.c $(RIOTBUILD_CONFIG_HEADER_C) + $(Q) $(CCACHE) $(CC) \ + -DRIOT_FILE_RELATIVE=\"$(patsubst $(RIOTBASE)/%,%,$<)\" \ + -DRIOT_FILE_NOPATH=\"$(notdir $<)\" \ + $(CFLAGS) $(INCLUDES) -MD -MP -c -o $@ $< + $(OBJCXX): $(BINDIR)/$(MODULE)/%.o: %.cpp $(RIOTBUILD_CONFIG_HEADER_C) $(Q)$(CCACHE) $(CXX) \ -DRIOT_FILE_RELATIVE=\"$(patsubst $(RIOTBASE)/%,%,$(abspath $<))\" \