diff --git a/Makefile.include b/Makefile.include index 4dbc9b08e2771d2bea506a6f8f0dcb105f130844..449b8c61ddd2e4a12be312e29cd97d331c892fae 100644 --- a/Makefile.include +++ b/Makefile.include @@ -387,7 +387,7 @@ endif # RIOTNOLINK $(ELFFILE): $(BASELIBS) $(Q)$(_LINK) -o $@ -$(BINDIR)/$(APPLICATION_MODULE).a: $(RIOTBUILD_CONFIG_HEADER_C) $(USEPKG:%=$(BINDIR)/%.a) $(APPDEPS) +$(BINDIR)/$(APPLICATION_MODULE).a: $(RIOTBUILD_CONFIG_HEADER_C) $(USEPKG:%=$(BINDIR)/%.a) $(APPDEPS) $(BUILDDEPS) $(Q)DIRS="$(DIRS)" "$(MAKE)" -C $(APPDIR) -f $(RIOTMAKE)/application.inc.mk $(BINDIR)/$(APPLICATION_MODULE).a: FORCE @@ -425,14 +425,14 @@ endef # The `clean` needs to be serialized before everything else. ifneq (, $(filter clean, $(MAKECMDGOALS))) - all $(BASELIBS) $(USEPKG:%=$(RIOTPKG)/%/Makefile.include) $(RIOTBUILD_CONFIG_HEADER_C) pkg-prepare: clean + all $(BASELIBS) $(USEPKG:%=$(RIOTPKG)/%/Makefile.include) $(RIOTBUILD_CONFIG_HEADER_C) pkg-prepare $(BUILDDEPS): clean endif .PHONY: pkg-prepare $(USEPKG:%=$(BINDIR)/%.a) pkg-prepare: -@for i in $(USEPKG) ; do "$(MAKE)" -C $(RIOTPKG)/$$i prepare ; done -$(USEPKG:%=$(BINDIR)/%.a): $(RIOTBUILD_CONFIG_HEADER_C) pkg-prepare +$(USEPKG:%=$(BINDIR)/%.a): $(RIOTBUILD_CONFIG_HEADER_C) pkg-prepare $(BUILDDEPS) @mkdir -p $(BINDIR) $(QQ)"$(MAKE)" -C $(RIOTPKG)/$(patsubst $(BINDIR)/%.a,%,$@) diff --git a/makefiles/vars.inc.mk b/makefiles/vars.inc.mk index b0cbac74749156fc965bcad137ac25882117dfb9..300fedbb2d110e6c666a2e000e81cb9b42c90282 100644 --- a/makefiles/vars.inc.mk +++ b/makefiles/vars.inc.mk @@ -17,6 +17,7 @@ export USEMODULE # Sys Module dependencies of the application. Set i export USEPKG # Pkg dependencies (third party modules) of the application. Set in the application's Makefile. export DISABLE_MODULE # Used in the application's Makefile to suppress DEFAULT_MODULEs. export APPDEPS # Files / Makefile targets that need to be created before the application can be build. Set in the application's Makefile. +# BUILDDEPS # Files / Makefile targets that need to be created before starting to build. export RIOTBASE # The root folder of RIOT. The folder where this very file lives in. export RIOTCPU # For third party CPUs this folder is the base of the CPUs.