Skip to content
Snippets Groups Projects
Unverified Commit fb10a181 authored by Gaëtan Harter's avatar Gaëtan Harter
Browse files

make: Add 'BUILDDEPS' variable

BUILDDEPS are files / make targets that should be build before compiling.
It can include packages source download, generating headers, modules.

It is the equivalent of `APPDEPS` but not limited to the application.
It cannot be done right now with `APPDEPS` as it is used in `BASELIBS` and
fixing it requires changing mips using it for source files.
parent 8bf468e8
No related branches found
No related tags found
No related merge requests found
...@@ -387,7 +387,7 @@ endif # RIOTNOLINK ...@@ -387,7 +387,7 @@ endif # RIOTNOLINK
$(ELFFILE): $(BASELIBS) $(ELFFILE): $(BASELIBS)
$(Q)$(_LINK) -o $@ $(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 $(Q)DIRS="$(DIRS)" "$(MAKE)" -C $(APPDIR) -f $(RIOTMAKE)/application.inc.mk
$(BINDIR)/$(APPLICATION_MODULE).a: FORCE $(BINDIR)/$(APPLICATION_MODULE).a: FORCE
...@@ -425,14 +425,14 @@ endef ...@@ -425,14 +425,14 @@ endef
# The `clean` needs to be serialized before everything else. # The `clean` needs to be serialized before everything else.
ifneq (, $(filter clean, $(MAKECMDGOALS))) 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 endif
.PHONY: pkg-prepare $(USEPKG:%=$(BINDIR)/%.a) .PHONY: pkg-prepare $(USEPKG:%=$(BINDIR)/%.a)
pkg-prepare: pkg-prepare:
-@for i in $(USEPKG) ; do "$(MAKE)" -C $(RIOTPKG)/$$i prepare ; done -@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) @mkdir -p $(BINDIR)
$(QQ)"$(MAKE)" -C $(RIOTPKG)/$(patsubst $(BINDIR)/%.a,%,$@) $(QQ)"$(MAKE)" -C $(RIOTPKG)/$(patsubst $(BINDIR)/%.a,%,$@)
......
...@@ -17,6 +17,7 @@ export USEMODULE # Sys Module dependencies of the application. Set i ...@@ -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 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 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. 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 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. export RIOTCPU # For third party CPUs this folder is the base of the CPUs.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment