From patchwork Tue Feb 3 14:21:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 435920 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 9862D1401DD for ; Wed, 4 Feb 2015 01:22:02 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id DA458A1B1B; Tue, 3 Feb 2015 14:22:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iiBU5g5qTsEa; Tue, 3 Feb 2015 14:21:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 975C0A1AF7; Tue, 3 Feb 2015 14:21:57 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 4D6D31C244D for ; Tue, 3 Feb 2015 14:21:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 46B0532FDE for ; Tue, 3 Feb 2015 14:21:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gk4sFpCEQpAl for ; Tue, 3 Feb 2015 14:21:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51]) by silver.osuosl.org (Postfix) with ESMTPS id 5628F2EEF8 for ; Tue, 3 Feb 2015 14:21:55 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id k14so44765624wgh.10 for ; Tue, 03 Feb 2015 06:21:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=5HqBFCK6Sh8Biq/JZkzSEEsmhohavMkiZA3G5EP563A=; b=gOMK9vfYEIpjCWmdDIYnmBU4WGqjVzOZHyt4VbOIoJBwMPvAxZEPMcdXna1G49vJWu 4D1ZgzzRZJVe8mZO3dHKgdfFoRAAWXt/ibbTzxOD2b3Yq5SOfkI513iMTVa92pZuwnR/ prXOIgGi8/Dv6Apav8/Ik3Q+g6XWcjnyEdqj3aMfMOISXaUMs1XehKJHw/bdFsCynvws adcMoWl7QJmUZX4gWNti3adfIZhFUHq+9Qfj1XqodReTvAPyzmNfXOHWP1HSWjc4MAXS MVjJYK1o0yfU9A6oQu1iDI29P/TV8a+kdV2PKFgml1MggpJ7GI7GgXilf3IRiJr4Ovlp demg== X-Received: by 10.194.10.68 with SMTP id g4mr55305258wjb.5.1422973313792; Tue, 03 Feb 2015 06:21:53 -0800 (PST) Received: from localhost.localdomain (ks3095497.kimsufi.com. [94.23.60.27]) by mx.google.com with ESMTPSA id k6sm2091105wia.6.2015.02.03.06.21.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Feb 2015 06:21:53 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Tue, 3 Feb 2015 15:21:42 +0100 Message-Id: <7ccc6d89131659797c40c30d84a58b49009388d4.1422972638.git.yann.morin.1998@free.fr> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: Cc: Thomas De Schampheleire , "Yann E. Morin" Subject: [Buildroot] [PATCH 02/10] kconfig infra: add support for defconfig files 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" From: Thomas De Schampheleire This commit adds support for using a defconfig file instead of a full .config. This is a precondition to migrate packages like linux and barebox to the kconfig infrastructure. Signed-off-by: Thomas De Schampheleire Signed-off-by: "Yann E. Morin" --- package/pkg-kconfig.mk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk index ef724e5..db56b7a 100644 --- a/package/pkg-kconfig.mk +++ b/package/pkg-kconfig.mk @@ -47,8 +47,13 @@ $$($(2)_KCONFIG_FILE): | $(1)-patch # The .config file is obtained by copying it from the specified source # configuration file, after the package has been patched. +# Since the file could be a defconfig file it needs to be expanded to a +# full .config first. We use 'make oldconfig' because this can be safely +# done even when the package does not support defconfigs. $$($(2)_DIR)/.config: $$($(2)_KCONFIG_FILE) $$(INSTALL) -m 0644 $$($(2)_KCONFIG_FILE) $$($(2)_DIR)/.config + @yes "" | $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \ + $$($(2)_KCONFIG_OPTS) oldconfig # In order to get a usable, consistent configuration, some fixup may be needed. # The exact rules are specified by the package .mk file. @@ -68,10 +73,22 @@ $$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $$($(2)_DIR)/.stamp_kconfig_fixup_ rm -f $$($(2)_DIR)/.stamp_{kconfig_fixup_done,configured,built} rm -f $$($(2)_DIR)/.stamp_{target,staging}_installed +$(1)-savedefconfig: $$($(2)_DIR)/.stamp_kconfig_fixup_done + $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \ + $$($(2)_KCONFIG_OPTS) savedefconfig + # Target to copy back the configuration to the source configuration file $(1)-update-config: $$($(2)_DIR)/.stamp_kconfig_fixup_done cp --preserve=timestamps -f $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE) +# Note: make sure the timestamp of the stored configuration is not newer than +# the .config to avoid a useless rebuild. Note that, contrary to +# $(1)-update-config, the reference for 'touch' is _not_ the file from which +# we copy. +$(1)-update-defconfig: $(1)-savedefconfig + cp -f $$($(2)_DIR)/defconfig $$($(2)_KCONFIG_FILE) + touch --reference $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE) + endef # inner-kconfig-package ################################################################################