From patchwork Wed Jun 29 05:06:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Bobroff X-Patchwork-Id: 641838 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rfW081J8xz9ssM for ; Wed, 29 Jun 2016 15:08:08 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 73FD83355B; Wed, 29 Jun 2016 05:08:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Uk3-T50Pyr+B; Wed, 29 Jun 2016 05:07:59 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 3D01833437; Wed, 29 Jun 2016 05:07:47 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 955351C0F5A for ; Wed, 29 Jun 2016 05:07:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8D69E8D34B for ; Wed, 29 Jun 2016 05:07:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R+PJDPYlVGgO for ; Wed, 29 Jun 2016 05:07:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by whitealder.osuosl.org (Postfix) with ESMTPS id 687C98C284 for ; Wed, 29 Jun 2016 05:06:51 +0000 (UTC) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u5T4x1eg011501 for ; Wed, 29 Jun 2016 01:06:50 -0400 Received: from e23smtp03.au.ibm.com (e23smtp03.au.ibm.com [202.81.31.145]) by mx0b-001b2d01.pphosted.com with ESMTP id 23uvadxd69-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 29 Jun 2016 01:06:49 -0400 Received: from localhost by e23smtp03.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 29 Jun 2016 15:06:46 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp03.au.ibm.com (202.81.31.209) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 29 Jun 2016 15:06:45 +1000 X-IBM-Helo: d23dlp03.au.ibm.com X-IBM-MailFrom: sam.bobroff@au1.ibm.com X-IBM-RcptTo: buildroot@busybox.net Received: from d23relay08.au.ibm.com (d23relay08.au.ibm.com [9.185.71.33]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 7506F3578052 for ; Wed, 29 Jun 2016 15:06:45 +1000 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u5T56jT96226240 for ; Wed, 29 Jun 2016 15:06:45 +1000 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u5T56j0T008143 for ; Wed, 29 Jun 2016 15:06:45 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u5T56iOH008133; Wed, 29 Jun 2016 15:06:44 +1000 Received: from tungsten.au.ibm.com (unknown [9.192.196.106]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 3ECA1A01EE; Wed, 29 Jun 2016 15:06:44 +1000 (AEST) From: Sam Bobroff To: buildroot@busybox.net Date: Wed, 29 Jun 2016 15:06:38 +1000 X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16062905-0008-0000-0000-0000009ED0C7 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16062905-0009-0000-0000-0000078EDF2B Message-Id: <0fddd32d7ed356b943e1372df20a0d9948ab29ed.1467176798.git.sam.bobroff@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-06-29_02:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1606290047 Cc: patrick@stwcx.xyz, sam@mendozajonas.com, eliner@us.ibm.com Subject: [Buildroot] [PATCH v3 1/6] Add support for merged defconfigs X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Sam Bobroff --- v3: * Documentation moved to separate patch. * Fixed "make savedefconfig". Makefile | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/Makefile b/Makefile index 78b44c5..9f3fc92 100644 --- a/Makefile +++ b/Makefile @@ -858,6 +858,44 @@ savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile .PHONY: defconfig savedefconfig +# Find the path of a config file that may be either in TOPDIR or BR2_EXTERNAL. +# Missing or duplicate matches must be checked for elsewhere. +define FIND_CONFIG_FILE = +$(foreach d,$(TOPDIR)/configs $(BR2_EXTERNAL)/configs,$(wildcard $(d)/$(1))) +endef + +define CONFIG_FILE_LIST = +$(foreach f,$1,$(call FIND_CONFIG_FILE,$f)) +endef + +# Check that each config file is found once and only once. +define CHECK_CONFIG_FILE_LIST = +$(foreach f,$(1), +ifeq "$(words $(call FIND_CONFIG_FILE,$(f)))" "0" +$$(error ERROR: Missing input file: $(f)) +else +ifneq "$(words $(call FIND_CONFIG_FILE,$(f)))" "1" +$$(error ERROR: Duplicate input file: $(f)) +endif +endif +) +endef + +# To be called by configuration fragments (*.mk) to set up defconfigs built +# by merge_config.sh, via the include that follows: +define merge_config = +$(call CHECK_CONFIG_FILE_LIST,$2 $3) +$(1): $$(BUILD_DIR)/buildroot-config/conf $(call CONFIG_FILE_LIST,$2 $3) outputmakefile + @mkdir $$(CONFIG_DIR)/.merge_config + @$$(TOPDIR)/support/kconfig/merge_config.sh -m -O $$(CONFIG_DIR)/.merge_config \ + $(call CONFIG_FILE_LIST,$2 $3) + @$$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$$(CONFIG_DIR)/.merge_config/.config \ + $$< --defconfig=$$(CONFIG_DIR)/.merge_config/.config $$(CONFIG_CONFIG_IN) + @rm -rf $$(CONFIG_DIR)/.merge_config +endef + +$(foreach d,$(TOPDIR)/configs $(BR2_EXTERNAL)/configs,$(eval -include $(d)/*.mk)) + ################################################################################ # # Cleanup and misc junk