From patchwork Mon Jun 1 05:56:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 11581295 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 956B492A for ; Mon, 1 Jun 2020 05:57:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7DEFF20734 for ; Mon, 1 Jun 2020 05:57:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590991072; bh=dV6dqElaI/RRFpu6svcTXWU1F1Afh2gyRYfnrwK66Y0=; h=From:To:Cc:Subject:Date:List-ID:From; b=wCye6P0OTMompJNZcKFtdb4Kc65/pm1XuS2LPyyA4tBPG1P+cA7Lf1LBXBGU0Kq2a 39wQL12hdJtcVOAsoLpkyh2j9wxmKp1aG8e7fGoxDL3U3C1RAdU3Q+wYF+4rWV3U0E rJ5Im9+s2q1g5gz63UFKV03l67vfvLfPFrJayocc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726116AbgFAF5w (ORCPT ); Mon, 1 Jun 2020 01:57:52 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:39125 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725952AbgFAF5v (ORCPT ); Mon, 1 Jun 2020 01:57:51 -0400 Received: from oscar.flets-west.jp (softbank126090202047.bbtec.net [126.90.202.47]) (authenticated) by conuserg-07.nifty.com with ESMTP id 0515vaLe023694; Mon, 1 Jun 2020 14:57:37 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com 0515vaLe023694 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1590991057; bh=hClu71YjeEoM6Vu18KHeyn59euJfqdWK4cwz1ZWo+0o=; h=From:To:Cc:Subject:Date:From; b=XmwjqNOMwrMyFQrC0w92aE/uW+U/I2SuStdzkIWNxFsPbaMCBhfi4RLPM2qGKi2q8 5ntx8HhktUrVQCmQzsnoNVEq94MgXAAFRnoZRrexCV8B6RdZQdsFx4oLbuSVGatUW5 WUGwKSERNnAbWLMLmC8poQWoBwGOsCmw7/Q+bmo2kj6dyT88BTHaQ5Kn2VNRpdVJ9X FAR7ha2P0WDo0bnpmeDrudlPvJdI+AvbjOjiZ3oqa5SVoFOWPIv5W9xgmZNcK4oZF9 4e8xyLgfj/zEhkmOMBBu0NSAtN0KUfLNuJYP/+/VqQOi75H/4f3fgyAxwQSZgnUEnm CP6zjW0qrSr9g== X-Nifty-SrcIP: [126.90.202.47] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada Subject: [PATCH 01/37] kbuild: refactor subdir-ym calculation Date: Mon, 1 Jun 2020 14:56:55 +0900 Message-Id: <20200601055731.3006266-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org Remove the unneeded variables, __subdir-y and __subdir-m. Signed-off-by: Masahiro Yamada --- scripts/Makefile.lib | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 0d931cc0df94..748e44d5a1e3 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -39,16 +39,14 @@ ifdef need-modorder modorder := $(patsubst %/,%/modules.order, $(filter %/, $(obj-y)) $(obj-m:.o=.ko)) endif +# Subdirectories we need to descend into +subdir-ym := $(sort $(subdir-y) $(subdir-m) \ + $(patsubst %/,%, $(filter %/, $(obj-y) $(obj-m)))) + # Handle objects in subdirs # --------------------------------------------------------------------------- # o if we encounter foo/ in $(obj-y), replace it by foo/built-in.a -# and add the directory to the list of dirs to descend into: $(subdir-y) # o if we encounter foo/ in $(obj-m), remove it from $(obj-m) -# and add the directory to the list of dirs to descend into: $(subdir-m) -__subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y))) -subdir-y += $(__subdir-y) -__subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m))) -subdir-m += $(__subdir-m) ifdef need-builtin obj-y := $(patsubst %/, %/built-in.a, $(obj-y)) else @@ -56,9 +54,6 @@ obj-y := $(filter-out %/, $(obj-y)) endif obj-m := $(filter-out %/, $(obj-m)) -# Subdirectories we need to descend into -subdir-ym := $(sort $(subdir-y) $(subdir-m)) - # If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo.o is a composite object multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))), $(m)))) multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))), $(m))))