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 v5 10/13] Makefile: refactor *config targets
Date: Thu, 6 Apr 2017 20:18:50 +0200	[thread overview]
Message-ID: <20170406181854.5242-10-arnout@mind.be> (raw)
In-Reply-To: <cover.1491502445.git.arnout@mind.be>

The rules for the *config targets are all very similar, so factor them
together using $@.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 Makefile | 42 ++++++------------------------------------
 1 file changed, 6 insertions(+), 36 deletions(-)

diff --git a/Makefile b/Makefile
index 1d377099b2..89eb748df6 100644
--- a/Makefile
+++ b/Makefile
@@ -846,50 +846,20 @@ config: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
 # no values are set for the legacy options so a subsequent oldconfig
 # will query them. Therefore, run an additional olddefconfig.
 
-oldconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
-	@$(COMMON_CONFIG_ENV) $< --oldconfig $(CONFIG_CONFIG_IN)
-
-randconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
-	@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --randconfig $(CONFIG_CONFIG_IN)
-	@$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
-
-allyesconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
-	@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --allyesconfig $(CONFIG_CONFIG_IN)
-	@$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
-
-allnoconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
-	@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --allnoconfig $(CONFIG_CONFIG_IN)
-	@$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
-
-randpackageconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
-	@grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
-	@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
-		KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
-		$< --randconfig $(CONFIG_CONFIG_IN)
-	@rm -f $(CONFIG_DIR)/.config.nopkg
+randconfig allyesconfig allnoconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
+	@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y $< --$@ $(CONFIG_CONFIG_IN)
 	@$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
 
-allyespackageconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
+randpackageconfig allyespackageconfig allnopackageconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
 	@grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
 	@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
 		KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
-		$< --allyesconfig $(CONFIG_CONFIG_IN)
+		$< --$(subst package,,$@) $(CONFIG_CONFIG_IN)
 	@rm -f $(CONFIG_DIR)/.config.nopkg
 	@$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
 
-allnopackageconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
-	@grep -v BR2_PACKAGE_ $(BR2_CONFIG) > $(CONFIG_DIR)/.config.nopkg
-	@$(COMMON_CONFIG_ENV) SKIP_LEGACY=y \
-		KCONFIG_ALLCONFIG=$(CONFIG_DIR)/.config.nopkg \
-		$< --allnoconfig $(CONFIG_CONFIG_IN)
-	@rm -f $(CONFIG_DIR)/.config.nopkg
-	@$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN) >/dev/null
-
-silentoldconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
-	$(COMMON_CONFIG_ENV) $< --silentoldconfig $(CONFIG_CONFIG_IN)
-
-olddefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
-	$(COMMON_CONFIG_ENV) $< --olddefconfig $(CONFIG_CONFIG_IN)
+oldconfig silentoldconfig olddefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
+	@$(COMMON_CONFIG_ENV) $< --$@ $(CONFIG_CONFIG_IN)
 
 defconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig
 	@$(COMMON_CONFIG_ENV) $< --defconfig$(if $(DEFCONFIG),=$(DEFCONFIG)) $(CONFIG_CONFIG_IN)
-- 
2.11.0

  parent reply	other threads:[~2017-04-06 18:18 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-06 18:18 [Buildroot] [PATCH v5 00/13] support/test-pkg: fixes and enhancements + add autobuild defconfigs Arnout Vandecappelle
2017-04-06 18:18 ` [Buildroot] [PATCH v5 01/13] docs/manual: document the test-pkg script Arnout Vandecappelle
2017-04-06 19:51   ` Thomas Petazzoni
2017-04-06 18:18 ` [Buildroot] [PATCH v5 02/13] support/test-pkg: print number of toolchains and progress Arnout Vandecappelle
2017-04-06 19:51   ` Thomas Petazzoni
2017-04-06 18:18 ` [Buildroot] [PATCH v5 03/13] support/test-pkg: calculate toolchain name only once Arnout Vandecappelle
2017-04-06 20:51   ` Yann E. MORIN
2017-04-07 10:35     ` Arnout Vandecappelle
2017-04-06 18:18 ` [Buildroot] [PATCH v5 04/13] support/test-pkg: run legal-info Arnout Vandecappelle
2017-04-06 18:18 ` [Buildroot] [PATCH v5 05/13] Makefile: support defconfigs in subdirectories Arnout Vandecappelle
2017-04-06 18:18 ` [Buildroot] [PATCH v5 06/13] configs: add autobuild toolchain defconfigs Arnout Vandecappelle
2017-04-06 19:55   ` Thomas Petazzoni
2017-04-06 20:39     ` Arnout Vandecappelle
2017-04-06 18:18 ` [Buildroot] [PATCH v5 07/13] support/test-pkg: move minimal.config into a separate file Arnout Vandecappelle
2017-04-06 18:18 ` [Buildroot] [PATCH v5 08/13] support/test-pkg: get configs from buildroot defconfigs Arnout Vandecappelle
2017-04-06 19:37   ` Thomas Petazzoni
2017-04-06 20:48     ` Yann E. MORIN
2017-04-06 20:50       ` Thomas Petazzoni
2017-04-07 10:35         ` Arnout Vandecappelle
2017-04-07 10:44           ` Thomas Petazzoni
2017-04-06 18:18 ` [Buildroot] [PATCH v5 09/13] support/test-pkg: add option to use an alternate toolchain directory Arnout Vandecappelle
2017-04-06 18:18 ` Arnout Vandecappelle [this message]
2017-04-06 18:18 ` [Buildroot] [PATCH v5 11/13] Makefile: add alldefconfig target Arnout Vandecappelle
2017-04-06 18:18 ` [Buildroot] [PATCH v5 12/13] support/test-pkg: use merge_config.sh to merge the fragments Arnout Vandecappelle
2017-04-06 18:18 ` [Buildroot] [PATCH v5 13/13] [RFC] list-defconfigs: support defconfigs in subdirectories Arnout Vandecappelle

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=20170406181854.5242-10-arnout@mind.be \
    --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.