From patchwork Thu Jul 24 18:57:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas De Schampheleire X-Patchwork-Id: 373500 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 3B55F1401F0 for ; Fri, 25 Jul 2014 05:00:32 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 4C3E532A63; Thu, 24 Jul 2014 19:00:31 +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 HJeqgWGS5KdI; Thu, 24 Jul 2014 19:00:25 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 0A1A632A28; Thu, 24 Jul 2014 19:00:19 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id BA0581C43FE for ; Thu, 24 Jul 2014 19:00:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B341D8AD2B for ; Thu, 24 Jul 2014 19:00:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Hl6yYi4kFHFd for ; Thu, 24 Jul 2014 19:00:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by whitealder.osuosl.org (Postfix) with ESMTPS id 939028B907 for ; Thu, 24 Jul 2014 19:00:08 +0000 (UTC) Received: by mail-wg0-f50.google.com with SMTP id n12so3156693wgh.33 for ; Thu, 24 Jul 2014 12:00:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:content-transfer-encoding:subject :message-id:in-reply-to:references:user-agent:date:from:to:cc; bh=2k1ZsbLCDM3D7roc5br+NvtiV+c2a1AHlt9hAixXlvc=; b=x1XsqqKc72M2qQraheXXFQIGWC+M2n2oIqyewuGjWDsIG0UgIvlZc4aV68v0vkysMm S1d1P8ICg59+dPr4pb65NTeiqt0E8lpYMfd10mP6NyibTOozYTKXv7uN8t9AeI4y9rlP 6bjRPOkmg22eYF1uXvkMqjoVn21KCxgkqHosg5Aa5mVZmy1Xy8BnIQXJdO1aI6dcly+p CfceskBgJzcnwyXCYwnTOgE44bCqycO2FycWN/VUsickzVmjxIh6MJeQhbdRK6FsiORB dcnWFKJSXHdKBWC752MssjBRXZcGUwzUYGhrag73jqqofsa8kiVnOxtYpV+6Mqkb1IUR 1qGg== X-Received: by 10.194.189.50 with SMTP id gf18mr15259905wjc.13.1406228407008; Thu, 24 Jul 2014 12:00:07 -0700 (PDT) Received: from [127.0.0.1] ([109.140.131.31]) by mx.google.com with ESMTPSA id w5sm26264730wif.3.2014.07.24.12.00.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jul 2014 12:00:06 -0700 (PDT) MIME-Version: 1.0 X-Mercurial-Node: a28bf078ba44af4a72a1147aeaed7d901874f573 Message-Id: In-Reply-To: References: User-Agent: Mercurial-patchbomb/2.7.2 Date: Thu, 24 Jul 2014 20:57:53 +0200 From: Thomas De Schampheleire To: buildroot@buildroot.org Cc: thomas.petazzoni@free-electrons.com, "Yann E. MORIN" Subject: [Buildroot] [PATCH 1 of 2] kconfig-package: add some comments to pkg-kconfig.mk X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Clarify what is happening in the kconfig infrastructure by adding some comments. Signed-off-by: Thomas De Schampheleire --- package/pkg-kconfig.mk | 48 ++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 47 insertions(+), 1 deletions(-) diff -r 4dc6eccbfc41 -r a28bf078ba44 package/pkg-kconfig.mk --- a/package/pkg-kconfig.mk Wed Jul 23 20:19:19 2014 +0200 +++ b/package/pkg-kconfig.mk Thu Jul 24 20:14:00 2014 +0200 @@ -1,33 +1,79 @@ +################################################################################ +# Kconfig package infrastructure +# +# This file implements an infrastructure that eases development of +# package .mk files for packages that use kconfig for configuration files. +# +# As this infrastructure only handles the kconfig configuration part, it +# should be used in combination with one of the other package infrastructures, +# like generic-package, autotools-package, ... +# +# See the Buildroot documentation for details on the usage of this +# infrastructure. +# +################################################################################ + +################################################################################ +# inner-kconfig-package -- generates the make targets needed to support a +# kconfig package +# +# argument 1 is the lowercase package name +# argument 2 is the uppercase package name, including a HOST_ prefix +# for host packages +# argument 3 is the uppercase package name, without the HOST_ prefix +# for host packages +# argument 4 is the type (target or host) +# +################################################################################ define inner-kconfig-package +# Default values + $(2)_KCONFIG_EDITORS ?= menuconfig $(2)_KCONFIG_OPT ?= $(2)_KCONFIG_FIXUP_CMDS ?= +# FOO_KCONFIG_FILE is required + ifndef $(2)_KCONFIG_FILE $$(error Internal error: no value specified for $(2)_KCONFIG_FILE) endif +# The .config file is obtained by copying it from the specified source +# configuration file, after the package has been patched. + $$($(2)_DIR)/.config: $$($(2)_KCONFIG_FILE) | $(1)-patch $$(INSTALL) -m 0644 $$($(2)_KCONFIG_FILE) $$($(2)_DIR)/.config +# In order to get a usable, consistent configuration, some fixup may be needed. +# The exact rules are specified by the package .mk file. + $$($(2)_DIR)/.stamp_kconfig_fixup_done: $$($(2)_DIR)/.config $$($(2)_KCONFIG_FIXUP_CMDS) $$(Q)touch $$@ +# Before running configure, the configuration file should be present and fixed + $$($(2)_TARGET_CONFIGURE): $$($(2)_DIR)/.stamp_kconfig_fixup_done -# configuration editors (menuconfig, ...) +# Configuration editors (menuconfig, ...) + $$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $$($(2)_DIR)/.config $$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \ $$($(2)_KCONFIG_OPT) $$(subst $(1)-,,$$@) rm -f $$($(2)_DIR)/.stamp_{kconfig_fixup_done,configured,built} rm -f $$($(2)_DIR)/.stamp_{target,staging}_installed +# Target to copy back the configuration to the source configuration file + $(1)-update-config: $$($(2)_DIR)/.stamp_kconfig_fixup_done cp -f $$($(2)_DIR)/.config $$($(2)_KCONFIG_FILE) endef # inner-kconfig-package +################################################################################ +# kconfig-package -- the target generator macro for kconfig packages +################################################################################ + kconfig-package = $(call inner-kconfig-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)))