From e84ce96dec683aba25ba5e620cef053fb588bbce Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Thu, 29 May 2014 17:40:02 -0500 Subject: Configuration-based compile RTC: 88436 Change-Id: Iab68e6a14641829ef29165694f5196f0ad437114 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/11374 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III --- makefile | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'makefile') diff --git a/makefile b/makefile index 94b12603c..ab751a331 100644 --- a/makefile +++ b/makefile @@ -23,6 +23,13 @@ SUBDIRS = src.d ROOTPATH = . +CONFIG_FILE ?= default + +GEN_PASS_PRE += $(GENDIR)/.$(notdir $(CONFIG_FILE)).config +CLEAN_TARGETS += $(wildcard $(GENDIR)/.*.config) +CLEAN_TARGETS += $(GENDIR)/config.mk $(GENDIR)/config.h +SKIP_CONFIG_FILE_LOAD = 1 + IMAGE_PASS_POST += $(GENDIR)/hwp_id.html CLEAN_TARGETS += $(GENDIR)/hwp_id.html ifndef BUILD_MINIMAL @@ -57,4 +64,18 @@ $(GENDIR)/hwp_id.html : check_istep_modules: $(OBJS) listdeps.pl $(IMGDIR) -v +GENCONFIG_TOOL = src/build/tools/hbGenConfig +$(GENDIR)/.$(notdir $(CONFIG_FILE)).config: \ + $(shell find -name HBconfig) \ + $(filter-out $(GENDIR)/.$(notdir $(CONFIG_FILE)).config,\ + $(wildcard $(GENDIR)/.*.config)) \ + $(GENCONFIG_TOOL) \ + $(filter-out default,$(CONFIG_FILE)) + @mkdir -p $(GENDIR) + $(C2) " GENCONFIG" + $(C1)$(GENCONFIG_TOOL) $(CONFIG_FILE) \ + $(filter-out $(GENCONFIG_TOOL) $(CONFIG_FILE) \ + $(wildcard $(GENDIR)/.*.config),$^) + @rm -f $(wildcard $(GENDIR)/.*.config) + @touch $@ -- cgit v1.2.1