diff --git a/Makefile.include b/Makefile.include index 94c75c4fa5..cea7c51fab 100644 --- a/Makefile.include +++ b/Makefile.include @@ -512,7 +512,8 @@ $(ELFFILE): $(BASELIBS) $(Q)$(_LINK) -o $@ $(BINDIR)/$(APPLICATION_MODULE).a: pkg-build $(BUILDDEPS) - $(Q)DIRS="$(DIRS)" "$(MAKE)" -C $(APPDIR) -f $(RIOTMAKE)/application.inc.mk + $(Q)DIRS="$(DIRS)" APPLICATION_BLOBS="$(BLOBS)" \ + "$(MAKE)" -C $(APPDIR) -f $(RIOTMAKE)/application.inc.mk $(BINDIR)/$(APPLICATION_MODULE).a: FORCE # Other modules are built by application.inc.mk and packages building diff --git a/makefiles/application.inc.mk b/makefiles/application.inc.mk index 5bbcb7c4ac..e34ad39f2f 100644 --- a/makefiles/application.inc.mk +++ b/makefiles/application.inc.mk @@ -3,4 +3,17 @@ MODULE = $(APPLICATION_MODULE) DIRS += $(RIOTCPU)/$(CPU) $(RIOTBOARD)/$(BOARD) DIRS += $(RIOTBASE)/core $(RIOTBASE)/drivers $(RIOTBASE)/sys +# For regular modules, adding files to BLOBS to their Makefile is sufficient to +# create the corresponding headers. +# +# Application modules are different, as they use this makefile to build, thus +# application level variables are not available unless exported. +# +# But exporting e.g., BLOBS, would pre-set the variable for all +# submakefiles. +# +# As workaround, $(RIOTBASE)/Makefile.include passes BLOBS to this +# Makefile as APPLICATION_BLOBS. +BLOBS = $(APPLICATION_BLOBS) + include $(RIOTBASE)/Makefile.base