From patchwork Tue Aug 6 06:39:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 170627 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp5270463ile; Mon, 5 Aug 2019 23:40:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqx69hNYisOngX3WceeiJvcyOnnzEtx6W9Mm9UKFnrvPsTaXAriV0QntFolxW6ZRYfqC/LMI X-Received: by 2002:a62:3c3:: with SMTP id 186mr2059901pfd.21.1565073624534; Mon, 05 Aug 2019 23:40:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565073624; cv=none; d=google.com; s=arc-20160816; b=Nf15ITxh/M98x+byv0/5OexXdfq6E8nZ7jFePv1J6jHW2JKBYVQd+shyM2ujIVgZF3 saEDi/ddcDkNF5F4KDa8vH0AqgxZ7Q6DCWYL7p7EqfPQSlhuvxU0qKh+idVxKsIdtAm/ d5LRU+r5L1DiKdH1Z3fY3aoREqZuAH0LXlW3K/tKmKDExsAOrSbi1RIS3wAMW2s7Eq5g hvxcZb++k3Ruum5/t1Z59ICg2uakpw/0s0q58NRV/LguXzl0qao/tISojQLq01KlciZR vs/vN1Rrb3orjShZdCjB/LABzahoj8xMTRVg0Z7qod8TrXxKJ0zmbAubEsgrAucW3/hP 55rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=JlCMJ6teUrNcdw5nNAsjPH8LD60KsqUoMPPEo50W3xc=; b=zKMNYBnioBozxEEwaRh1gARiqrX3ckhWKjfA4GddF1nlfaZmkhRPJ6IR+QmPlE8ru9 z2zqy0oXQFCgM1+wVzqaFIl1hsyJGA0NzowWHPuHbt0d7a7WnPUz3kIPWqtG9dhWCvbf EvnLkOyd8a5ndJxReeJyG5sLzYOgWJAj5uZQe0fNyn9SWisnV41Ln8ooAd7XonoNQMTC ttZ+h1tDWzdrTlJwrZdhwBPXlbJt7bdteUf5zrKgQ3RAedwxQu0VOo4jycfb1StosGZD MPGZAtFSZl8WIn2ooz0LWnX3XcIKwhfNF2iiCFYffdWjfSK6TXeLyoE5FPtmetz3FUtH LwkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=o38ZfvGh; 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 y7si46215084pgi.401.2019.08.05.23.40.24; Mon, 05 Aug 2019 23:40:24 -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=o38ZfvGh; 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 S1731882AbfHFGkX (ORCPT + 29 others); Tue, 6 Aug 2019 02:40:23 -0400 Received: from conuserg-12.nifty.com ([210.131.2.79]:39569 "EHLO conuserg-12.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731560AbfHFGkW (ORCPT ); Tue, 6 Aug 2019 02:40:22 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id x766dO7o002982; Tue, 6 Aug 2019 15:39:26 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com x766dO7o002982 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1565073566; bh=JlCMJ6teUrNcdw5nNAsjPH8LD60KsqUoMPPEo50W3xc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o38ZfvGh/J6sdmxHNVHbtsTBc2XwPxzojhdjO4Tpd5Jc6Kzy3Zyr1LlhLCxVY+2f9 uk76CsF2MDxirJh84AVmMmt6NOth+0HBQPu5zFCIvUBB9oIDLxBAVuAbmyjDh7EzI1 3DsBEU6VC8lh+rnT/JTp0odTWLocGhmPr6h+S4phlAxrKXp32wW51UWyJkZMsKfTUE IlFNSH6XyHBqMuOWmUMKRl7IVl3vH4lNHWSeNApCXuk5fda/N4ooUM9ZJ7jVazWlVq JHln5DDcHshnn+BrPkCbnohTiM/CkKCA1sdMz+B2qsu7/29jB2Ov327e/YC8obEZ3K JOX12HqWukreA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Jani Nikula , intel-gfx@lists.freedesktop.org, Sam Ravnborg , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 1/5] kbuild: treat an object as multi-used when $(foo-) is set Date: Tue, 6 Aug 2019 15:39:19 +0900 Message-Id: <20190806063923.1266-2-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190806063923.1266-1-yamada.masahiro@socionext.com> References: <20190806063923.1266-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, Kbuild treats an object as multi-used when any of $(foo-objs), $(foo-y), $(foo-m) is set. It makes more sense to check $(foo-) as well. In the context of foo-$(CONFIG_FOO_FEATURE1), CONFIG_FOO_FEATURE1 could be unset. Signed-off-by: Masahiro Yamada --- scripts/Makefile.lib | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 41c50f9461e5..0a540599823e 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -41,9 +41,9 @@ 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)))) +# 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)))) multi-used := $(multi-used-y) $(multi-used-m) # $(subdir-obj-y) is the list of objects in $(obj-y) which uses dir/ to @@ -52,8 +52,8 @@ subdir-obj-y := $(filter %/built-in.a, $(obj-y)) # Replace multi-part objects by their individual parts, # including built-in.a from subdirectories -real-obj-y := $(foreach m, $(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) -real-obj-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m))) +real-obj-y := $(foreach m, $(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) +real-obj-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m))) # DTB # If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built