From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 93971B0AC for ; Wed, 14 May 2014 17:55:24 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 14 May 2014 08:55:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,1053,1389772800"; d="scan'208";a="531856582" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 14 May 2014 08:55:21 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s4EFtKei006521; Wed, 14 May 2014 16:55:20 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id s4EFtKBW016841; Wed, 14 May 2014 16:55:20 +0100 Received: (from bricha3@localhost) by sivswdev02.ir.intel.com with id s4EFtKn5016837; Wed, 14 May 2014 16:55:20 +0100 From: Bruce Richardson To: dev@dpdk.org Date: Wed, 14 May 2014 16:55:10 +0100 Message-Id: <1400082910-16804-1-git-send-email-bruce.richardson@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1400062955-27338-1-git-send-email-bruce.richardson@intel.com> References: <1400062955-27338-1-git-send-email-bruce.richardson@intel.com> Subject: [dpdk-dev] [PATCH v2] mk: allow updates to build config on make install X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 May 2014 15:55:25 -0000 When running "make config" and additional config.orig file is also generated, which is intended to hold the original, clean configuration from the template. When running make install, we first check if there is no existing .config file, and run make config if not. If there is a file, we then check if it's unmodified, in which case we regenerate a new .config to take account of any possible updates to the template. Finally, in the case where there is an existing .config file, and it HAS been modified, we then do a check to see if the template has had further updates, and throw an error if so. If no updates, we continue with the build using the existing, user-modified config. Signed-off-by: Bruce Richardson --- mk/rte.sdkconfig.mk | 1 + mk/rte.sdkinstall.mk | 10 ++++++++++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/mk/rte.sdkconfig.mk b/mk/rte.sdkconfig.mk index d0692e7..3124dce 100644 --- a/mk/rte.sdkconfig.mk +++ b/mk/rte.sdkconfig.mk @@ -74,6 +74,7 @@ $(RTE_OUTPUT)/.config: $(RTE_CONFIG_TEMPLATE) FORCE -o $(RTE_OUTPUT)/.config_tmp $(RTE_CONFIG_TEMPLATE) ; \ if ! cmp -s $(RTE_OUTPUT)/.config_tmp $(RTE_OUTPUT)/.config; then \ cp $(RTE_OUTPUT)/.config_tmp $(RTE_OUTPUT)/.config ; \ + cp $(RTE_OUTPUT)/.config_tmp $(RTE_OUTPUT)/.config.orig ; \ fi ; \ rm -f $(RTE_OUTPUT)/.config_tmp ; \ else \ diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk index 61a8771..25ebf6b 100644 --- a/mk/rte.sdkinstall.mk +++ b/mk/rte.sdkinstall.mk @@ -54,10 +54,20 @@ INSTALL_TARGETS := $(addsuffix _install,\ .PHONY: install install: $(INSTALL_TARGETS) + %_install: @echo ================== Installing $* $(Q)if [ ! -f $(BUILD_DIR)/$*/.config ]; then \ $(MAKE) config T=$* O=$(BUILD_DIR)/$*; \ + elif cmp -s $(BUILD_DIR)/$*/.config.orig $(BUILD_DIR)/$*/.config; then \ + $(MAKE) config T=$* O=$(BUILD_DIR)/$*; \ + else \ + $(MAKE) config T=$* O=/tmp/$*; \ + if ! cmp -s /tmp/$*/.config.orig $(BUILD_DIR)/$*/.config.orig ; then \ + echo "Config Conflict: Local config and standard config have both changed" ; \ + exit 1; \ + fi ; \ + echo "Using local configuration" ; \ fi $(Q)$(MAKE) all O=$(BUILD_DIR)/$* -- 1.7.0.7