From patchwork Thu Jul 16 22:03:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 496918 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id F0F9F140284 for ; Fri, 17 Jul 2015 08:03:52 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 1CD2594D4F; Thu, 16 Jul 2015 22:03:52 +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 aTfZAuWJ1rHH; Thu, 16 Jul 2015 22:03:51 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 6736094D45; Thu, 16 Jul 2015 22:03:51 +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 120961CE764 for ; Thu, 16 Jul 2015 22:03:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 0EC1594D45 for ; Thu, 16 Jul 2015 22:03:51 +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 j60+SydBMCIR for ; Thu, 16 Jul 2015 22:03:50 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from exchange.essensium.com (220.77.144.195.ipv4.evonet.be [195.144.77.220]) by hemlock.osuosl.org (Postfix) with ESMTPS id AB6E094D18 for ; Thu, 16 Jul 2015 22:03:48 +0000 (UTC) Received: from localhost.localdomain (10.3.7.11) by beleexch01.local.ess-mail.com (10.3.7.8) with Microsoft SMTP Server (TLS) id 15.0.847.32; Fri, 17 Jul 2015 00:03:34 +0200 From: "Arnout Vandecappelle (Essensium/Mind)" To: Date: Fri, 17 Jul 2015 00:03:30 +0200 Message-ID: <1437084210-25086-1-git-send-email-arnout@mind.be> X-Mailer: git-send-email 2.1.4 In-Reply-To: <20150716225237.367d958a@free-electrons.com> References: <20150716225237.367d958a@free-electrons.com> MIME-Version: 1.0 X-Originating-IP: [10.3.7.11] X-ClientProxiedBy: beleexch01.local.ess-mail.com (10.3.7.8) To beleexch01.local.ess-mail.com (10.3.7.8) Cc: =?UTF-8?q?Guido=20Mart=C3=ADnez?= Subject: [Buildroot] [PATCH] Makefile: fix performance regression introduced by "Makefile: don't depend on the umask" 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: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Commit bee5745c introduced an extra level of 'make' when the umask is different from 0022. However, when several targets were specified on the command line, a new make instance would be called for each target. This introduces a huge performance overhead when many targets are specified on the command line. To fix this, use the same approach as used in the mkmakefile script: an addition target on which the MAKECMDGOALS depend, so that this target is run only once. Note that the mkmakefile script contains a special exception for Makefile, because the Makefile in the output directory is generated. Since the top-level Makefile is not generated, this exception is not needed here. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) Cc: Guido Martínez --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index c7d6bee..b4ef2fa 100644 --- a/Makefile +++ b/Makefile @@ -29,11 +29,11 @@ UMASK=0022 ifneq ($(shell umask),$(UMASK)) .PHONY: all $(MAKECMDGOALS) -all: - @umask $(UMASK) && $(MAKE) --no-print-directory +_all: + @umask $(UMASK) && $(MAKE) --no-print-directory $(MAKEARGS) $(MAKECMDGOALS) -$(MAKECMDGOALS): - @umask $(UMASK) && $(MAKE) --no-print-directory $@ +$(MAKECMDGOALS): _all + @: else # umask