diff --git a/Makefile b/Makefile index 3f527d6cb..fc6fed558 100644 --- a/Makefile +++ b/Makefile @@ -78,12 +78,17 @@ BIN = libapps$(LIBEXT) all: $(BIN) .PHONY: import install context context_serialize context_rest .depdirs preconfig depend clean distclean +define MAKE_template + $(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" BIN_DIR="$(BIN_DIR)" + +endef + define SDIR_template $(1)_$(2): $(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" BIN_DIR="$(BIN_DIR)" + endef -$(foreach SDIR, $(BUILDIRS), $(eval $(call SDIR_template,$(SDIR),preconfig))) $(foreach SDIR, $(CONFIGURED_APPS), $(eval $(call SDIR_template,$(SDIR),all))) $(foreach SDIR, $(CONFIGURED_APPS), $(eval $(call SDIR_template,$(SDIR),install))) $(foreach SDIR, $(CONFIGURED_APPS), $(eval $(call SDIR_template,$(SDIR),context))) @@ -116,7 +121,7 @@ context: context_serialize $(TOPDIR)/.config: Kconfig: $(TOPDIR)/.config - $(foreach SDIR, $(BUILDIRS), $(SDIR)_preconfig) + $(foreach SDIR, $(BUILDIRS), $(call MAKE_template,$(SDIR),preconfig)) $(Q) $(MKKCONFIG) preconfig: Kconfig