From patchwork Tue Oct 10 20:43:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 824052 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="oLyDQMF+"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yBTbn6XDhz9sBd for ; Wed, 11 Oct 2017 07:43:49 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 6D49189520; Tue, 10 Oct 2017 20:43:46 +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 ShhxNDc7R1fq; Tue, 10 Oct 2017 20:43:44 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id D2E7D894A4; Tue, 10 Oct 2017 20:43:43 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 7A9D11C232E for ; Tue, 10 Oct 2017 20:43:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 69D8388B6B for ; Tue, 10 Oct 2017 20:43:40 +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 T3H4Z1gqd0AP for ; Tue, 10 Oct 2017 20:43:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 9260388B46 for ; Tue, 10 Oct 2017 20:43:39 +0000 (UTC) Received: by mail-wm0-f65.google.com with SMTP id u138so251009wmu.0 for ; Tue, 10 Oct 2017 13:43:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gG2bjMs3UbDr+jAOIZL0BJ6fRphcbyaR2qMMmeD5wcs=; b=oLyDQMF+DpmR6bnNYvsfWNJharO79eEhrpjStYr3gVhO6mkdJ/MyKRN5xlsakUTJc2 ksO/0RbXDln8UR+p4k4TdnPvthbZC6GzfTiSKk6nIGaNWJL/1Z5PmCjI/+ZNbIrmYCiS D5tCs7tNPTwMIFnn5HiEvHKcPaG8qtn9h89LkaSd+vbjPPB8xaPvltDGrnLlD/AGtmrs OIg+IoIbpDCgHLG04czhnARc2EGZDJav2k2H5j/Ui9Y7H+mJPEya8pY4AbTwM3qpZlnT nZfsHd30FBFiKlwqZsJv+91+GKln+K3FyxB+G63w/N45LQfPRcTG+FpI4qK3q8v/8oVy cb0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gG2bjMs3UbDr+jAOIZL0BJ6fRphcbyaR2qMMmeD5wcs=; b=graoh6LFs+LD+x3taHkYKj2DOgIQuxeScuGzNaQKfIW28TRJ7uRpiqZLLwC1ZLsgMF KBD9K2pXWsQyA+gunvEEuCHzefC5TzljiWmVVBwiHzGHI5bngWGOj7/B5UGoVJoEEM8q 0MQw7t5fFF8mu9vlz7Feqyt+Af4foumrh9Kl1qLOzYamG3Ovb+3dAbJz/+b1YjuMDQOZ m9C8qmb6ULAiT8993CUIOCMoRo8qvrx+XPwkI+jmtUmeURfuQGbyCK8jo1XYSX/yFcjV JsIr0WoDalgO893uXCRvnpIw8ovtWNvDnqRC9pAz6k8STVxqaHUQ2tQt7U6tp6ZbxGLu Be3A== X-Gm-Message-State: AMCzsaXuQdKRVbrkVUaBYaIDFS7QL5eslwZTVzacr4MlrdyZc5m+3n5W EfbAq+H36JiwIdXVPyiHLNY1F9wm X-Google-Smtp-Source: AOwi7QArtS+p8acKAOxGZpRjxFlFZW87X8DO1QsHW5AOgtt9xpGIUrso0N+HnI7224/x5tj72NyDig== X-Received: by 10.223.163.215 with SMTP id m23mr12712499wrb.32.1507668217705; Tue, 10 Oct 2017 13:43:37 -0700 (PDT) Received: from localhost.localdomain ([89.202.204.147]) by smtp.gmail.com with ESMTPSA id 55sm12339205wrw.60.2017.10.10.13.43.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Oct 2017 13:43:36 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 10 Oct 2017 22:43:29 +0200 Message-Id: <1507668210-5427-3-git-send-email-angelo.compagnucci@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507668210-5427-1-git-send-email-angelo.compagnucci@gmail.com> References: <1507668210-5427-1-git-send-email-angelo.compagnucci@gmail.com> Subject: [Buildroot] [RFC 2/3] Makefile: add handling of software stacks 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" Software stacks are a new way to express a bundle of configuration options that should be used togheter. A software stack is orthogonal to a classic buildroot config: a software stack indeed could be shared beetween multiple configs. A software stack could be used with standard buildroot tools, like: make qt5-fb_stack The fragment called qt5-fb_stack is merged inside current .config and everithing is checked to produce a valid configurationqt5-fb_stack is merged inside current .config and everithing is checked to produce a valid configuration. Signed-off-by: Angelo Compagnucci --- Makefile | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 02f7cda..27283b8 100644 --- a/Makefile +++ b/Makefile @@ -128,7 +128,7 @@ export BR2_VERSION_FULL := $(BR2_VERSION)$(shell $(TOPDIR)/support/scripts/setlo # List of targets and target patterns for which .config doesn't need to be read in noconfig_targets := menuconfig nconfig gconfig xconfig config oldconfig randconfig \ - defconfig %_defconfig allyesconfig allnoconfig alldefconfig silentoldconfig release \ + defconfig %_defconfig %_stack allyesconfig allnoconfig alldefconfig silentoldconfig release \ randpackageconfig allyespackageconfig allnopackageconfig \ print-version olddefconfig distclean manual manual-% @@ -146,7 +146,7 @@ nobuild_targets := source %-source source-check \ clean distclean help show-targets graph-depends \ %-graph-depends %-show-depends %-show-version \ graph-build graph-size list-defconfigs \ - savedefconfig printvars + list-stacks savedefconfig printvars ifeq ($(MAKECMDGOALS),) BR_BUILDING = y else ifneq ($(filter-out $(nobuild_targets),$(MAKECMDGOALS)),) @@ -919,6 +919,12 @@ define percent_defconfig endef $(eval $(foreach d,$(call reverse,$(TOPDIR) $(BR2_EXTERNAL_DIRS)),$(call percent_defconfig,$(d))$(sep))) +define percent_stack +%_stack: $(1)/stacks/%_stack + $(TOPDIR)/support/kconfig/merge_config.sh -b -O $(BASE_DIR) $(BR2_CONFIG) $(1)/stacks/$$@ +endef +$(eval $(foreach d,$(call reverse,$(TOPDIR) $(BR2_EXTERNAL_DIRS)),$(call percent_stack,$(d))$(sep))) + savedefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig @$(COMMON_CONFIG_ENV) $< \ --savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \ @@ -1039,6 +1045,7 @@ help: @echo ' graph-depends - generate graph of the dependency tree' @echo ' graph-size - generate stats of the filesystem size' @echo ' list-defconfigs - list all defconfigs (pre-configured minimal systems)' + @echo ' list-stacks - list all stacks (pre-configured group of packages)' @echo @echo 'Miscellaneous:' @echo ' source - download all sources needed for offline-build' @@ -1075,6 +1082,26 @@ define list-defconfigs $${first} || printf "\n" endef +# List the stacks files +# $(1): base directory +# $(2): br2-external name, empty for bundled +define list-stacks + @first=true; \ + for stack in $(1)/stacks/*_stack; do \ + [ -f "$${stack}" ] || continue; \ + if $${first}; then \ + if [ "$(2)" ]; then \ + printf 'External stacks in "$(call qstrip,$(2))":\n'; \ + else \ + printf "Built-in stacks:\n"; \ + fi; \ + first=false; \ + fi; \ + printf " %-35s - %s\n" ""$${stack##*/}"" "$$(head -n1 $${stack} | sed 's/^##*//' )"; \ + done; \ + $${first} || printf "\n" +endef + # We iterate over BR2_EXTERNAL_NAMES rather than BR2_EXTERNAL_DIRS, # because we want to display the name of the br2-external tree. .PHONY: list-defconfigs @@ -1084,6 +1111,15 @@ list-defconfigs: $(call list-defconfigs,$(BR2_EXTERNAL_$(name)_PATH),\ $(BR2_EXTERNAL_$(name)_DESC))$(sep)) +# We iterate over BR2_EXTERNAL_NAMES rather than BR2_EXTERNAL_DIRS, +# because we want to display the name of the br2-external tree. +.PHONY: list-stacks +list-stacks: + $(call list-stacks,$(TOPDIR)) + $(foreach name,$(BR2_EXTERNAL_NAMES),\ + $(call list-stacks,$(BR2_EXTERNAL_$(name)_PATH),\ + $(BR2_EXTERNAL_$(name)_DESC))$(sep)) + release: OUT = buildroot-$(BR2_VERSION) # Create release tarballs. We need to fiddle a bit to add the generated