aboutsummaryrefslogtreecommitdiffstats
path: root/include/subdir.mk
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2009-11-10 22:00:54 +0000
committerFelix Fietkau <nbd@openwrt.org>2009-11-10 22:00:54 +0000
commit579d54038bab2423a65701255db6919f4df51183 (patch)
tree422232790754478411291b203b087bcb02f3a6e7 /include/subdir.mk
parent1dbcfdaf2f52ee208a7ee88f09f0642dbdb6c882 (diff)
downloadupstream-579d54038bab2423a65701255db6919f4df51183.tar.gz
upstream-579d54038bab2423a65701255db6919f4df51183.tar.bz2
upstream-579d54038bab2423a65701255db6919f4df51183.zip
build system: introduce a new feature called build variants. it allows building a package multiple times in one pass with different build dirs, based on the same build settings. replaces templating hacks like the one used in the hostapd package
SVN-Revision: 18357
Diffstat (limited to 'include/subdir.mk')
-rw-r--r--include/subdir.mk4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/subdir.mk b/include/subdir.mk
index 3c1e3f9cae..b8094afb2e 100644
--- a/include/subdir.mk
+++ b/include/subdir.mk
@@ -35,7 +35,9 @@ define subdir
)
$(call warn_eval,$(1)/$(bd),t,T,$(1)/$(bd)/$(target): $(if $(QUILT),,$($(1)/$(bd)/$(target)) $(call $(1)//$(target),$(1)/$(bd))))
$(if $(BUILD_LOG),@mkdir -p $(BUILD_LOG_DIR)/$(1)/$(bd))
- +$(if $(BUILD_LOG),set -o pipefail;) $$(SUBMAKE) -C $(1)/$(bd) $(target) $(if $(BUILD_LOG),SILENT= 2>&1 | tee $(BUILD_LOG_DIR)/$(1)/$(bd)/$(target).txt) $(if $(findstring $(bd),$($(1)/builddirs-ignore-$(target))), || $(call MESSAGE, ERROR: $(1)/$(bd) failed to build.))
+ $(foreach variant,$(if $(BUILD_VARIANT),$(BUILD_VARIANT),$(if $($(1)/$(bd)/variants),$($(1)/$(bd)/variants),__default)),
+ +$(if $(BUILD_LOG),set -o pipefail;) $$(SUBMAKE) -C $(1)/$(bd) $(target) BUILD_VARIANT="$(filter-out __default,$(variant))" $(if $(BUILD_LOG),SILENT= 2>&1 | tee $(BUILD_LOG_DIR)/$(1)/$(bd)/$(target).txt) $(if $(findstring $(bd),$($(1)/builddirs-ignore-$(target))), || $(call MESSAGE, ERROR: $(1)/$(bd) failed to build$(if $(filter-out __default,$(variant)), (build variant: $(variant))).))
+ )
$$(if $(call debug,$(1)/$(bd),v),,.SILENT: $(1)/$(bd)/$(target))
# legacy targets