From patchwork Fri Jul 26 02:17: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: 169777 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp12375567ilk; Thu, 25 Jul 2019 19:18:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxcvvlwr4M1J/jGv4YRilaY4TdCHezh8qN2LT/j9dt+Lh2XFF93GRYQDvzxN2u1TGl6e3q2 X-Received: by 2002:a17:902:d917:: with SMTP id c23mr93867116plz.248.1564107492340; Thu, 25 Jul 2019 19:18:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564107492; cv=none; d=google.com; s=arc-20160816; b=QpxNOWV7UXonB8KBk8ADD5b9Z7N/JzBRZmr40L50rc/uyyQbSZNlqICK+CWcleAVlr 2hAH5Yf6+iPQd3RVzYPUPXwoew4G5AF7hdcg5F3MOWvfDL+7Sg8vcW6SUhSHiL2H5dx0 r/vHichHUh2YQqTS2qEq8X01ZCPkLDxMbNoQ3HlqyxMcuk/hulzUEnEv2E/dREvSWILT U0eontcdyN+FiRro2POb2ik6iXOJSd5aWwmg844OcGepOBmi819L3ZSxNFHXpnFdfOEi WQ+wyC8C/0mVhk36oa2FBg3sZc+N8/wAKjFJ2NLwV3y0HPYsYRtvcDN3KqYwUF+80xew mK5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=sP8514OambOv5RPYsCOuewPkI9Z9loIm68XJqeC4lrU=; b=mGVa7qIoxeabrlmm4UfhKU/CYafr24mfOAuyAwiOZ+BLDAnN+k2lplhmdliEYlLWJk p5x0gFrvTFUQRKtDKNmQv62bAfuvQgMryKHmaREmPSVqEm7V2JKoUjg6jVj/o/Cr1cQa JUMfO/YHdqofkkXlHDjZkP5r3xz/FpPXYQ2pfdh4qmlhWiOErUKhK9XzbPaEsZWbt5u4 ybJoMVncr2Oge/BfbhuzdLnT1kLCLjNKGTqUxzjzAzrDYNk+xOd4ssoSNobxL5PgeAI/ hB/RKJwjeqLV3Q21JWDSjHTX6U6On7Z5HzR1NsfRoMhfsZ4jfSPfP15afapLMUDCZqGe 0YfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=zOS6XRj0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h16si12625776pgl.318.2019.07.25.19.18.12; Thu, 25 Jul 2019 19:18:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=zOS6XRj0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726248AbfGZCSK (ORCPT + 29 others); Thu, 25 Jul 2019 22:18:10 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:21982 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725851AbfGZCSK (ORCPT ); Thu, 25 Jul 2019 22:18:10 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id x6Q2HpYX016459; Fri, 26 Jul 2019 11:17:51 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x6Q2HpYX016459 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1564107471; bh=sP8514OambOv5RPYsCOuewPkI9Z9loIm68XJqeC4lrU=; h=From:To:Cc:Subject:Date:From; b=zOS6XRj0+hlcW4b/6zpOW0Zr5pw6BuIo22oRb8e9zrpc3c7QXcJXOt2ysHjBDiUjC oolxTvpoAk2+bVVxbnWLGVOv3xKntaKnEZLOwUwTnQfzmD0ZJ+hB7ocnYLcqzM4xJI F/AS2ptsKi8acYM75T8rkRW78vDVY7UHGA1x/YvQ+Lb3WS5kqxp0/DA/KFNu6YjZ/i q76l7DpWrkY9QXA1BWtTA0dWDgy67qNl3HJ+wkcGgs7IEf5ajk4IjkBnJLnTLHpEHb HIOM+ZjBXnKVN0QHr89Q781FphEymRqErOL+SWhZw6JbkGT66LqhqucUYJK6KdpCOx Z4Xd4ohMHRLKQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: clean-up subdir-ym computation Date: Fri, 26 Jul 2019 11:17:47 +0900 Message-Id: <20190726021747.5021-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The intermediate variables __subdir-{y,m} are unneeded. Signed-off-by: Masahiro Yamada --- scripts/Makefile.lib | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) -- 2.17.1 diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 41c50f9461e5..444574963cb5 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -20,27 +20,20 @@ obj-m := $(filter-out $(obj-y),$(obj-m)) # Filter out objects already built-in lib-y := $(filter-out $(obj-y), $(sort $(lib-y) $(lib-m))) +# Subdirectories we need to descend into +subdir-ym := $(sort $(subdir-y) $(subdir-m) $(patsubst %/,%, $(filter %/, $(obj-y) $(obj-m)))) + # Determine modorder. # Unfortunately, we don't have information about ordering between -y # and -m subdirs. Just put -y's first. modorder := $(patsubst %/,%/modules.order, $(filter %/, $(obj-y)) $(obj-m:.o=.ko)) # 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) +# When we encounter foo/ in $(obj-y), link foo/built-in.a into vmlinux, +# but we do not do that for $(obj-m) obj-y := $(patsubst %/, %/built-in.a, $(obj-y)) obj-m := $(filter-out %/, $(obj-m)) -# Subdirectories we need to descend into -subdir-ym := $(sort $(subdir-y) $(subdir-m)) - # if $(foo-objs), $(foo-y), or $(foo-m) exists, foo.o is a composite object multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m)))) multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))), $(m))))