From 33b876306db2272c77e8e14e82758178aec96090 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 7 Jun 2016 08:58:48 -0600 Subject: [PATCH] preconfig target only executes if .config file changes --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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