From patchwork Wed Oct 16 05:15:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11192393 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BA8E01668 for ; Wed, 16 Oct 2019 05:17:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 911B92067D for ; Wed, 16 Oct 2019 05:17:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nifty.com header.i=@nifty.com header.b="dD5ADPdM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726696AbfJPFRI (ORCPT ); Wed, 16 Oct 2019 01:17:08 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:16529 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726423AbfJPFRI (ORCPT ); Wed, 16 Oct 2019 01:17:08 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id x9G5FoQ3015921; Wed, 16 Oct 2019 14:15:50 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x9G5FoQ3015921 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1571202951; bh=7esRt800qRlkwyQ3paFYTyNUrseNp3QJ3LafPyce9PM=; h=From:To:Cc:Subject:Date:From; b=dD5ADPdMZFPpOjl0GTtVKjMRhAvvnHLxO0n78B3/rdszRxgz6FtAf+zFVVCM63bg3 dEZwXv04YqdVFw7xkAzoyomMUwHwOcVo0I8imT8ZVEtsUsCMekaS23SVaIC8aY+L+n 25LugesoShcNpDNyw525EwYAJ5OsE9LagO5oxzGxXXXqqWShkLa6KSdrhBuDgHgV6y fipLPoAOxmNPwBzjRZidnWVlThfWG2xyqtZFdS/H9+XliqV9LUGntIqWeQ5Fq01exI QPl9sK90ctqR5VxS1+qc35mzhkp3nxa7iw63wDGm1SOk5E+K99oiV35As3PDKVt+GA cXX0MsSPmzmFQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Julia Lawall , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] kbuild: reduce KBUILD_SINGLE_TARGETS as descending into subdirectories Date: Wed, 16 Oct 2019 14:15:46 +0900 Message-Id: <20191016051547.11399-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org KBUILD_SINGLE_TARGETS does not need to contain all the targets. Change it to keep track the targets only from the current directory and its subdirectories. Signed-off-by: Masahiro Yamada --- scripts/Makefile.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index a9e47953ca53..dcbb0124dac4 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -469,15 +469,15 @@ targets += $(call intermediate_targets, .asn1.o, .asn1.c .asn1.h) \ ifdef single-build +KBUILD_SINGLE_TARGETS := $(filter $(obj)/%, $(KBUILD_SINGLE_TARGETS)) + curdir-single := $(sort $(foreach x, $(KBUILD_SINGLE_TARGETS), \ $(if $(filter $(x) $(basename $(x)).o, $(targets)), $(x)))) # Handle single targets without any rule: show "Nothing to be done for ..." or # "No rule to make target ..." depending on whether the target exists. unknown-single := $(filter-out $(addsuffix /%, $(subdir-ym)), \ - $(filter $(obj)/%, \ - $(filter-out $(curdir-single), \ - $(KBUILD_SINGLE_TARGETS)))) + $(filter-out $(curdir-single), $(KBUILD_SINGLE_TARGETS))) __build: $(curdir-single) $(subdir-ym) ifneq ($(unknown-single),) From patchwork Wed Oct 16 05:15:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11192395 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7BFBD15AB for ; Wed, 16 Oct 2019 05:17:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5D67420873 for ; Wed, 16 Oct 2019 05:17:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nifty.com header.i=@nifty.com header.b="JN8HLDv6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727701AbfJPFRI (ORCPT ); Wed, 16 Oct 2019 01:17:08 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:16530 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726648AbfJPFRI (ORCPT ); Wed, 16 Oct 2019 01:17:08 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-10.nifty.com with ESMTP id x9G5FoQ4015921; Wed, 16 Oct 2019 14:15:51 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com x9G5FoQ4015921 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1571202952; bh=QtgpQ/my2rTeLEaCijY9xyHVCu56r8/Xe5J3OP0ouag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JN8HLDv6MMIPtYbJAW3nPi19uX8f0i4WrIiXmjuNROywzjsZkPG82oWq5MjXyzscO 3tMNft3xUxDy4AI8xybNsSSR8fSYhaJdh0nEEE78PbnhucETCLe5+CLeCrWh116/h4 QFgEc8JflOgn3ouaBEMWHcyGTDYZRrSybiQkSDavavyw5TojECZ3FSGVra8p+Y2J7w burxT3QWsh8axh8KZIb6bPRWC9HSuquNGc4WYUUlYyKThrBHJfzAfPnFZkWu6bbEXd PoiK8PX9w/cDMaT6b5Q4Mu7Hu+/5yxIb60+bn4XykG3+PmRc2P4nEO0kewA41hVqU8 WQNxNgd7x/CHw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Julia Lawall , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] kbuild: make target builds much faster Date: Wed, 16 Oct 2019 14:15:47 +0900 Message-Id: <20191016051547.11399-2-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191016051547.11399-1-yamada.masahiro@socionext.com> References: <20191016051547.11399-1-yamada.masahiro@socionext.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Since commit 394053f4a4b3 ("kbuild: make single targets work more correctly"), building single targets is really slow. Speed it up by not descending into unrelated directories. Signed-off-by: Masahiro Yamada --- scripts/Makefile.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index dcbb0124dac4..7eabbb66a65c 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -479,7 +479,10 @@ curdir-single := $(sort $(foreach x, $(KBUILD_SINGLE_TARGETS), \ unknown-single := $(filter-out $(addsuffix /%, $(subdir-ym)), \ $(filter-out $(curdir-single), $(KBUILD_SINGLE_TARGETS))) -__build: $(curdir-single) $(subdir-ym) +single-subdirs := $(foreach d, $(subdir-ym), \ + $(if $(filter $(d)/%, $(KBUILD_SINGLE_TARGETS)), $(d))) + +__build: $(curdir-single) $(single-subdirs) ifneq ($(unknown-single),) $(Q)$(MAKE) -f /dev/null $(unknown-single) endif