All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 08/13] Store BR2_DEFCONFIG in .config, and use it to update the original input
Date: Sun, 14 Oct 2012 01:14:27 +0200	[thread overview]
Message-ID: <20121013231427.17317.48487.stgit@localhost> (raw)
In-Reply-To: <20121013231344.17317.92930.stgit@localhost>

From: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

defconfig file after updating the configuration.

Also use $(PROJECT_DIR) by default.

As a side-effect of this change, the *config options have been moved out
of the BR2_HAVE_DOT_CONFIG condition.  Also, the defconfig and savedefconfig
targets do need to include .config now, which makes them slightly slower.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 Config.in |   13 +++++++++++++
 Makefile  |   22 +++++++++++++---------
 2 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/Config.in b/Config.in
index 8cefcc6..4111409 100644
--- a/Config.in
+++ b/Config.in
@@ -29,6 +29,19 @@ config BR2_PROJECT_DIR
 	  This option is used to set defaults for many other configuration
 	  variables.  Each one of those can still be overridden individually.
 
+config BR2_DEFCONFIG_FROM_ENV
+	string
+	option env="BR2_DEFCONFIG"
+
+config BR2_DEFCONFIG
+	string "Location to save buildroot config"
+	default "$(PROJECT_DIR)/buildroot.config" if BR2_PROJECT_DIR != ""
+	default BR2_DEFCONFIG_FROM_ENV if BR2_DEFCONFIG_FROM_ENV != ""
+	default "defconfig"
+	help
+	  When running 'make savedefconfig', the defconfig file will be saved
+	  in this location.
+
 menu "Build options"
 
 menu "Commands"
diff --git a/Makefile b/Makefile
index d6136ed..cbaa0c4 100644
--- a/Makefile
+++ b/Makefile
@@ -56,7 +56,7 @@ DATE:=$(shell date +%Y%m%d)
 export BR2_VERSION_FULL:=$(BR2_VERSION)$(shell $(TOPDIR)/support/scripts/setlocalversion)
 
 noconfig_targets:=menuconfig nconfig gconfig xconfig config oldconfig randconfig \
-	defconfig %_defconfig savedefconfig allyesconfig allnoconfig silentoldconfig release \
+	%_defconfig allyesconfig allnoconfig silentoldconfig release \
 	randpackageconfig allyespackageconfig allnopackageconfig \
 	source-check print-version
 
@@ -97,6 +97,7 @@ ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
 endif
 
 PROJECT_DIR = $(realpath $(call qstrip,$(BR2_PROJECT_DIR)))
+DEFCONFIG = $(call qstrip,$(BR2_DEFCONFIG))
 
 # To put more focus on warnings, be less verbose as default
 # Use 'make V=1' to see the full commands
@@ -545,6 +546,8 @@ else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
 
 all: menuconfig
 
+endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
+
 # configuration
 # ---------------------------------------------------------------------------
 
@@ -560,6 +563,7 @@ COMMON_CONFIG_ENV = \
 	KCONFIG_AUTOHEADER=$(BUILD_DIR)/buildroot-config/autoconf.h \
 	KCONFIG_TRISTATE=$(BUILD_DIR)/buildroot-config/tristate.config \
 	BR2_PROJECT_DIR=$(PROJECT_DIR) \
+	BR2_DEFCONFIG=$(DEFCONFIG) \
 	BUILDROOT_CONFIG=$(CONFIG_DIR)/.config
 
 xconfig: $(BUILD_DIR)/buildroot-config/qconf outputmakefile
@@ -626,24 +630,24 @@ silentoldconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
 	$(COMMON_CONFIG_ENV) $< --silentoldconfig $(CONFIG_CONFIG_IN)
 
-defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
-	@mkdir -p $(BUILD_DIR)/buildroot-config
-	@$(COMMON_CONFIG_ENV) $< --defconfig$(if $(BR2_DEFCONFIG),=$(BR2_DEFCONFIG)) $(CONFIG_CONFIG_IN)
-
 %_defconfig: $(BUILD_DIR)/buildroot-config/conf $(TOPDIR)/configs/%_defconfig outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
 	@$(COMMON_CONFIG_ENV) $< --defconfig=$(TOPDIR)/configs/$@ $(CONFIG_CONFIG_IN)
 
+defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
+	@mkdir -p $(BUILD_DIR)/buildroot-config
+	@$(COMMON_CONFIG_ENV) $< --defconfig$(if $(DEFCONFIG),=$(DEFCONFIG)) $(CONFIG_CONFIG_IN)
+
 savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
-	@$(COMMON_CONFIG_ENV) $< --savedefconfig=$(CONFIG_DIR)/defconfig $(CONFIG_CONFIG_IN)
+	@$(COMMON_CONFIG_ENV) $< \
+		--savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \
+		$(CONFIG_CONFIG_IN)
 
 # check if download URLs are outdated
 source-check:
 	$(MAKE) DL_MODE=SOURCE_CHECK $(EXTRAMAKEARGS) source
 
-endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
-
 #############################################################
 #
 # Cleanup and misc junk
@@ -757,5 +761,5 @@ print-version:
 
 include docs/manual/manual.mk
 
-.PHONY: $(noconfig_targets)
+.PHONY: $(noconfig_targets) defconfig savedefconfig
 

  parent reply	other threads:[~2012-10-13 23:14 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-13 23:13 [Buildroot] [PATCH 00/13] Add support for a project directory Arnout Vandecappelle
2012-10-13 23:13 ` [Buildroot] [PATCH 01/13] Add BR2_PROJECT_DIR config option Arnout Vandecappelle
2012-10-13 23:13 ` [Buildroot] [PATCH 02/13] Set default BR2_PACKAGE_OVERRIDE_FILE based on BR2_PROJECT_DIR Arnout Vandecappelle
2012-10-13 23:14 ` [Buildroot] [PATCH 03/13] linux: get default paths from BR2_PROJECT_DIR Arnout Vandecappelle
2012-10-13 23:14 ` [Buildroot] [PATCH 04/13] busybox: " Arnout Vandecappelle
2012-10-13 23:14 ` [Buildroot] [PATCH 05/13] target/generic: " Arnout Vandecappelle
2012-10-13 23:14 ` [Buildroot] [PATCH 06/13] toolchain-crosstool-ng: " Arnout Vandecappelle
2012-10-13 23:14 ` [Buildroot] [PATCH 07/13] uClibc: " Arnout Vandecappelle
2012-10-13 23:14 ` Arnout Vandecappelle [this message]
2012-10-14 18:37   ` [Buildroot] [PATCH 08/13] Store BR2_DEFCONFIG in .config, and use it to update the original input Thomas De Schampheleire
2012-10-13 23:14 ` [Buildroot] [PATCH 09/13] Skip menuconfig if BR2_DEFCONFIG or BR2_PROJECT_DIR is given Arnout Vandecappelle
2012-10-13 23:14 ` [Buildroot] [PATCH 10/13] Add update-all-config target Arnout Vandecappelle
2012-10-14 18:45   ` Thomas De Schampheleire
2012-10-20 16:47     ` Arnout Vandecappelle
2012-10-20 16:52       ` Arnout Vandecappelle
2012-12-03 14:18     ` Stephan Hoffmann
2012-12-03 16:41       ` Thomas Petazzoni
2012-10-13 23:14 ` [Buildroot] [PATCH 11/13] Add target to create a project directory Arnout Vandecappelle
2012-10-13 23:21   ` [Buildroot] [PATCH v2] " Arnout Vandecappelle
2012-10-13 23:35     ` Valentine Barshak
2012-10-14 12:50       ` Arnout Vandecappelle
2012-10-16 17:36         ` Valentine Barshak
2012-10-13 23:14 ` [Buildroot] [PATCH 12/13] target/generic: add filesystem overlay option Arnout Vandecappelle
2012-10-14  0:39   ` Danomi Manchego
2012-10-14 12:53     ` Arnout Vandecappelle
2012-10-14 16:12       ` Danomi Manchego
2012-10-14 18:50   ` Thomas De Schampheleire
2012-10-20 16:15     ` Arnout Vandecappelle
2012-10-13 23:14 ` [Buildroot] [PATCH 13/13] Document BR2_PROJECT_DIR in the manual Arnout Vandecappelle
2012-10-14  8:35 ` [Buildroot] [PATCH 00/13] Add support for a project directory Thomas Petazzoni
2012-10-14  8:46   ` Thomas Petazzoni
2012-10-14 10:43     ` Arnout Vandecappelle
2012-10-14 12:55       ` Thomas Petazzoni
2012-10-14 13:57         ` Arnout Vandecappelle
2012-10-16 20:03   ` Arnout Vandecappelle
2012-10-17 17:26     ` Thomas Petazzoni
2012-10-17 18:42       ` Sagaert Johan
2012-10-14 18:56 ` Thomas De Schampheleire

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121013231427.17317.48487.stgit@localhost \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.