Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,11 @@ LINKFLAGPREFIX ?= -Wl,

DIRS += $(EXTERNAL_MODULE_DIRS)

# Define dependencies required for building (headers, downloading source files,)
BUILDDEPS += $(RIOTBUILD_CONFIG_HEADER_C)
BUILDDEPS += pkg-prepare
BUILDDEPS += $(APPDEPS)

# Save value to verify it is not modified later
_BASELIBS_VALUE_BEFORE_USAGE := $(BASELIBS)

Expand All @@ -387,7 +392,7 @@ endif # RIOTNOLINK
$(ELFFILE): $(BASELIBS)
$(Q)$(_LINK) -o $@

$(BINDIR)/$(APPLICATION_MODULE).a: $(RIOTBUILD_CONFIG_HEADER_C) $(USEPKG:%=$(BINDIR)/%.a) $(APPDEPS)
$(BINDIR)/$(APPLICATION_MODULE).a: $(USEPKG:%=$(BINDIR)/%.a) $(BUILDDEPS)
$(Q)DIRS="$(DIRS)" "$(MAKE)" -C $(APPDIR) -f $(RIOTMAKE)/application.inc.mk
$(BINDIR)/$(APPLICATION_MODULE).a: FORCE

Expand Down Expand Up @@ -425,14 +430,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) $(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): $(BUILDDEPS)
@mkdir -p $(BINDIR)
$(QQ)"$(MAKE)" -C $(RIOTPKG)/$(patsubst $(BINDIR)/%.a,%,$@)

Expand Down
1 change: 1 addition & 0 deletions makefiles/vars.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down