From patchwork Mon Apr 16 11:58:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Becker X-Patchwork-Id: 898605 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AxXNkC9I"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Pn3l1v2bz9s08 for ; Mon, 16 Apr 2018 21:59:14 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B1E068804A; Mon, 16 Apr 2018 11:59:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c07GXpAJCT14; Mon, 16 Apr 2018 11:59:10 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 273FD88002; Mon, 16 Apr 2018 11:59:10 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id D20D21C08F2 for ; Mon, 16 Apr 2018 11:59:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id CF2FC87FF8 for ; Mon, 16 Apr 2018 11:59:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bTuYFNw8sjiU for ; Mon, 16 Apr 2018 11:59:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) by hemlock.osuosl.org (Postfix) with ESMTPS id 003B687FF7 for ; Mon, 16 Apr 2018 11:59:07 +0000 (UTC) Received: by mail-lf0-f67.google.com with SMTP id r125-v6so4912406lfe.2 for ; Mon, 16 Apr 2018 04:59:07 -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=whgmNdLszZi6l4LU6Oz9jFTvazhhBzmjDPSQ3yCIwnc=; b=AxXNkC9IYe7Ywu5nYjRZmkqTYW0yeqzFDUV+GrtKdzZYgzVEkcTxRcwWIecrWjZVUA IUEy5j3YeASeajppfNXZj/k/nMfWmU1JFOdvVeC1QFbw/TveppkLVx/Xd8ATGRdfrmeM N+1x6AbT0ajJYDm/xl7bnmx59mhmhec9tRAbY8AQJBdyqHfLdRTlpvhkXRi9kTGEFj6U WrgsRNbvzVpD4ZsJYZP7wlOQk4PJxQf5YtnhGF2X67MyRGLEcGBWouNk1ugWT83SY4ql ngvxKU46j0Z47e/BB4HtroelYM0JW0ACEn6AiuESmWStTuaQQLxU3lUF/+o+pe24RF5W 0IZw== 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=whgmNdLszZi6l4LU6Oz9jFTvazhhBzmjDPSQ3yCIwnc=; b=hNM5TJ3PPCEBN2AfEo4agHhIl1yh/7f5/h7XXWLw7dibJN0mVXsoRUrS8kvirZt6lt vBOGlcBZZ9xqlDHecAn3Hd6vt1AguKfEE6v1T1i9F5L7ezY5f0sh/j4yVaUkERaz9lJH /qzIP9j+Zg0RBvYe6egYZjB8T+zgaAVNR0h23ihxSI7YTrTMWZgZL+jS3dK2pk6dK2hx tlBd3///sAtg5MwbgHKOF5KP6G5znhcojNSyq3ISUgKCUi0hGFhiI1p1zbnh4Kn1quKE 9PV6ybYee4ytP8uZRGB6APErmHuYG8zTISUieC1JF6vizzwgb61t1gjlQkXP257K07iA 1P+Q== X-Gm-Message-State: ALQs6tBb4jlQHVy5927/I5KTp/Tse5pGfNZb0VIeCU7oF0YTZUNBgkQa x8yngG+82KyZuI64xTaP4nbqturB6Yo= X-Google-Smtp-Source: AIpwx48/C8IXhtppnXsGH8nk7IFy7ab4K+EXaIf79fHG7+9JJbJwUnpckJoqks0gpbYL05NT/pegPw== X-Received: by 10.46.146.13 with SMTP id k13mr8902331ljg.70.1523879945958; Mon, 16 Apr 2018 04:59:05 -0700 (PDT) Received: from stefanb-lnx.localdomain ([62.121.61.82]) by smtp.gmail.com with ESMTPSA id n131-v6sm2831583lfn.55.2018.04.16.04.59.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Apr 2018 04:59:05 -0700 (PDT) From: Stefan Becker To: buildroot@buildroot.org Date: Mon, 16 Apr 2018 14:58:55 +0300 Message-Id: <20180416115855.26762-1-chemobejk@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: References: Subject: [Buildroot] [PATCH RESEND] core: enhance printvars for variables with newlines X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Becker , "Yann E . MORIN" , Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" If the variable content has newlines in it then the currently dumped content can't be fed again to GNU make. Add the option DEFINE_VARS which causes the variables to be dumped using define VAR ... line 1 ... ... line 2 ... ... endef Updated the manual accordingly. Signed-off-by: Stefan Becker --- Makefile | 10 +++++++--- docs/manual/make-tips.txt | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 0724f28f45..3e27195de0 100644 --- a/Makefile +++ b/Makefile @@ -974,9 +974,13 @@ printvars: $(sort $(if $(VARS),$(filter $(VARS),$(.VARIABLES)),$(.VARIABLES))), \ $(if $(filter-out environment% default automatic, \ $(origin $V)), \ - $(if $(QUOTED_VARS),\ - $(info $V='$(subst ','\'',$(if $(RAW_VARS),$(value $V),$($V)))'), \ - $(info $V=$(if $(RAW_VARS),$(value $V),$($V)))))) + $(if $(DEFINE_VARS), \ + $(info define $V) \ + $(info $(if $(RAW_VARS),$(value $V),$($V))) \ + $(info endef), \ + $(if $(QUOTED_VARS),\ + $(info $V='$(subst ','\'',$(if $(RAW_VARS),$(value $V),$($V)))'), \ + $(info $V=$(if $(RAW_VARS),$(value $V),$($V))))))) # ' Syntax colouring... .PHONY: clean diff --git a/docs/manual/make-tips.txt b/docs/manual/make-tips.txt index ea1d825bef..ba87e5d873 100644 --- a/docs/manual/make-tips.txt +++ b/docs/manual/make-tips.txt @@ -92,6 +92,8 @@ It is possible to tweak the output using some variables: - +VARS+ will limit the listing to variables which names match the specified make-pattern +- +DEFINE_VARS+, if set to +YES+, will use define...endef to preserve + newlines in the value - +QUOTED_VARS+, if set to +YES+, will single-quote the value - +RAW_VARS+, if set to +YES+, will print the unexpanded value @@ -106,6 +108,24 @@ For example: BUSYBOX_RDEPENDENCIES=ncurses util-linux ---- +---- + $ make -s printvars VARS=BUSYBOX_%DEPENDENCIES DEFINE_VARS=YES + define BUSYBOX_DEPENDENCIES + skeleton toolchain + endef + define BUSYBOX_FINAL_ALL_DEPENDENCIES + skeleton toolchain + endef + define BUSYBOX_FINAL_DEPENDENCIES + skeleton toolchain + endef + define BUSYBOX_FINAL_PATCH_DEPENDENCIES + endef + define BUSYBOX_RDEPENDENCIES + ncurses util-linux'linux-pam skeleton toolchain host-skeleton host-ccache + endef +---- + ---- $ make -s printvars VARS=BUSYBOX_%DEPENDENCIES QUOTED_VARS=YES BUSYBOX_DEPENDENCIES='skeleton toolchain'