From patchwork Tue Feb 9 01:32:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 580583 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id AC4101402D8 for ; Tue, 9 Feb 2016 12:32:33 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 892F3A755F; Tue, 9 Feb 2016 02:32:30 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ny2CGlX8zLQZ; Tue, 9 Feb 2016 02:32:30 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E1A18A752D; Tue, 9 Feb 2016 02:32:29 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E0C55A752D for ; Tue, 9 Feb 2016 02:32:26 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QaXPDOim2YCZ for ; Tue, 9 Feb 2016 02:32:26 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from avon.wwwdotorg.org (avon.wwwdotorg.org [70.85.31.133]) by theia.denx.de (Postfix) with ESMTPS id 8C414A745C for ; Tue, 9 Feb 2016 02:32:21 +0100 (CET) Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id 1EC7A64A5; Mon, 8 Feb 2016 18:32:20 -0700 (MST) Received: from swarren-lx1.nvidia.com (localhost [127.0.0.1]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id 7001AE40CA; Mon, 8 Feb 2016 18:32:19 -0700 (MST) From: Stephen Warren To: u-boot@lists.denx.de, Masahiro Yamada Date: Mon, 8 Feb 2016 18:32:14 -0700 Message-Id: <1454981534-15925-1-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 2.7.0 X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.98.6 at avon.wwwdotorg.org X-Virus-Status: Clean Cc: Tom Rini , Stephen Warren Subject: [U-Boot] [PATCH] Makefile: remove BUILD_TAG from KBUILD_CFLAGS X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Stephen Warren If BUILD_TAG is part of KBUILD_CFLAGS, then any time the value changes, all files get rebuilt. In a continuous integration environment, the value will change every build. This wastes time assuming that incremental builds would otherwise occur. To solve this, remove BUILD_TAG from KBUILD_FLAGS and add it to the end of "local version". This has other advantages too: - The special case for BUILD_TAG in display_options.c can be removed. - The version printed by the "version" command exactly matches what is printed at boot. Old sign-on message: U-Boot 2016.03-rc1-00044-g4085db5e767b (Feb ...), Build: bar-bas New sign-on message: U-Boot 2016.03-rc1-00044-g4085db5e767b-bar-baz (Feb ...) Signed-off-by: Stephen Warren --- Makefile | 4 ---- lib/display_options.c | 4 ---- scripts/setlocalversion | 4 ++++ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 42fad45afee1..2265b8995a7b 100644 --- a/Makefile +++ b/Makefile @@ -562,10 +562,6 @@ else KBUILD_CFLAGS += -O2 endif -ifdef BUILD_TAG -KBUILD_CFLAGS += -DBUILD_TAG='"$(BUILD_TAG)"' -endif - KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector) KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks) diff --git a/lib/display_options.c b/lib/display_options.c index 29343fc00e3f..5dcdf4e429af 100644 --- a/lib/display_options.c +++ b/lib/display_options.c @@ -15,11 +15,7 @@ int display_options (void) { -#if defined(BUILD_TAG) - printf ("\n\n%s, Build: %s\n\n", version_string, BUILD_TAG); -#else printf ("\n\n%s\n\n", version_string); -#endif return 0; } diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 63d91e22ed7c..4ef6603b5c27 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion @@ -171,4 +171,8 @@ else fi fi +if test -n "${BUILD_TAG}"; then + res="$res-${BUILD_TAG}" +fi + echo "$res"