Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2373710pxb; Sat, 27 Feb 2021 22:16:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJzsXJvDB5CErpxY+4+OJBSieTvTkrpxjkLflXqJuVeoq0HOUtkrrpPCgg9+wwgqLnGTX/YC X-Received: by 2002:a50:ec07:: with SMTP id g7mr10596436edr.72.1614492997666; Sat, 27 Feb 2021 22:16:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614492997; cv=none; d=google.com; s=arc-20160816; b=k8tRS3Yon/8u1DUAjuzLN0I0f1DCGqsgwV5tMWjTtCqAl//fIYJ4zGuCoY21dGXgdx aKJpA/8V1xtlAkG7361vLzVWQh+p2QKNDJ/llHKLI01gnkCQTHP/eXweR4p+YnlAj94c TvhbQrJCOf2yU4noDCvEjKQblPmJndzxLWprJGjJspvSVArrH0AubfBEExySj+CMJdZv 53kFqzV0rOooFVfRivIwQKri5NGzz9YX9hjNiXNIa+r5zk6hmWa9Ra1HH3LeDJqXs+0l W04+EaHlrYxLevmIRhtfTpSePaOT6g8JgiqbyP1gZ3UVsBE7GqU0t4wcxZGspOcoLsFK QXfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=aUTqDhVEnLjOAyKo+0/IlpAwcOFUETFtjuQZffEl/jQ=; b=mfg6SlQT9DdUzkAnH+BTedfr2NEmmx9PkUHp351Hj88XLLd0PIHuyTSeOQ/tiLRqf+ Xx84bIFWqgT5KUEsJv1nYVOBE9+WGoyxDoS9b+zCU2FF7/zPXpOFjM5oMvEcGrPn6Vt0 wRIlC593CcHqmDKpsZH8xxBoWzE0S0SsaeXsb+kZMvJWvSoHRqE87Ppmvc4zCADpsVMk J8b10Nv7JVrw1F55loRn4dMklEttfVSW57JWWONrZRJprcTrlQx9IhiMJMuUa5fePA7l VnYETApydy4vjwBxLac9Mss0iBMQjrg7Kb/pV1H4mbeE1YNsH2dw0QegXeY3b2dnWkV+ fKgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=esZTnLAK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i11si1035912edl.441.2021.02.27.22.16.15; Sat, 27 Feb 2021 22:16:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=esZTnLAK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230295AbhB1GLx (ORCPT + 99 others); Sun, 28 Feb 2021 01:11:53 -0500 Received: from conuserg-07.nifty.com ([210.131.2.74]:55337 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229638AbhB1GLq (ORCPT ); Sun, 28 Feb 2021 01:11:46 -0500 Received: from oscar.flets-west.jp (softbank126026090165.bbtec.net [126.26.90.165]) (authenticated) by conuserg-07.nifty.com with ESMTP id 11S6Aags009638; Sun, 28 Feb 2021 15:10:37 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com 11S6Aags009638 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1614492637; bh=aUTqDhVEnLjOAyKo+0/IlpAwcOFUETFtjuQZffEl/jQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=esZTnLAK45Mms294tzR7hhyE8rwpcc5oOzxZLAnroGNjU8p+VRcFLG0xFHJCMS90g fDppRTZb3eWZAa5RTt7j+MIbkPmEVHvYAZZTyRYjvke7sH4j1FUdHHdrbQVRYuX3Km MtMt8562eGlPgGiKNqtY9E4noqR1wB9sWKSYSfUJaF8op1pBngzerQML+5DnQnYuei JeyU87D9e0qZdEWD8q1+zXDB+GoG8AZh9RObYjp5yfMOQPmRWlYISIBRC8n5A4mpdf Ml8UJKxwvI3JACHVwdlRapayB6yQO/jY5egajKTqKJ5BTzL6uo+pKSaprM5HHjY8i/ bilEWQDf6Bmkw== X-Nifty-SrcIP: [126.26.90.165] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Michal Marek Subject: [PATCH 2/4] kbuild: prefix $(srctree)/ to some included Makefiles Date: Sun, 28 Feb 2021 15:10:26 +0900 Message-Id: <20210228061028.239459-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210228061028.239459-1-masahiroy@kernel.org> References: <20210228061028.239459-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org VPATH is used in Kbuild to make pattern rules to search for prerequisites in both $(objtree) and $(srctree). Some source files may not be real sources, but generated by tools such as flex, bison, perl. In contrast, I doubt the benefit of --include-dir=$(abs_srctree) because it is always clear which Makefiles are real sources, and which are not. So, my hope is to add $(srctree)/ prefix to all check-in Makefiles, then remove --include-dir=$(abs_srctree) flag in the future. I am touching only some Kbuild core parts for now. Treewide fixes will be needed to achieve this goal. Signed-off-by: Masahiro Yamada --- Makefile | 8 ++++---- scripts/Makefile.asm-generic | 4 ++-- scripts/Makefile.build | 8 ++++---- scripts/Makefile.clean | 2 +- scripts/Makefile.dtbinst | 2 +- scripts/Makefile.headersinst | 2 +- scripts/Makefile.modinst | 2 +- scripts/Makefile.modpost | 4 ++-- scripts/Makefile.modsign | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index c84a9311df29..2253e31a6bcf 100644 --- a/Makefile +++ b/Makefile @@ -338,14 +338,14 @@ __build_one_by_one: else # !mixed-build -include scripts/Kbuild.include +include $(srctree)/scripts/Kbuild.include # Read KERNELRELEASE from include/config/kernel.release (if it exists) KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION -include scripts/subarch.include +include $(srctree)/scripts/subarch.include # Cross compiling and selecting different set of gcc/bin-utils # --------------------------------------------------------------------------- @@ -590,7 +590,7 @@ ifdef config-build # Read arch specific Makefile to set KBUILD_DEFCONFIG as needed. # KBUILD_DEFCONFIG may point out an alternative default configuration # used for 'make defconfig' -include arch/$(SRCARCH)/Makefile +include $(srctree)/arch/$(SRCARCH)/Makefile export KBUILD_DEFCONFIG KBUILD_KCONFIG CC_VERSION_TEXT config: outputmakefile scripts_basic FORCE @@ -677,7 +677,7 @@ RETPOLINE_VDSO_CFLAGS := $(call cc-option,$(RETPOLINE_VDSO_CFLAGS_GCC),$(call cc export RETPOLINE_CFLAGS export RETPOLINE_VDSO_CFLAGS -include arch/$(SRCARCH)/Makefile +include $(srctree)/arch/$(SRCARCH)/Makefile ifdef need-config ifdef may-sync-config diff --git a/scripts/Makefile.asm-generic b/scripts/Makefile.asm-generic index 82ad63dcd62b..1d501c57f9ef 100644 --- a/scripts/Makefile.asm-generic +++ b/scripts/Makefile.asm-generic @@ -14,10 +14,10 @@ src := $(subst /generated,,$(obj)) # $(generic)/Kbuild lists mandatory-y. Exclude um since it is a special case. ifneq ($(SRCARCH),um) -include $(generic)/Kbuild +include $(srctree)/$(generic)/Kbuild endif -include scripts/Kbuild.include +include $(srctree)/scripts/Kbuild.include redundant := $(filter $(mandatory-y) $(generated-y), $(generic-y)) redundant += $(foreach f, $(generic-y), $(if $(wildcard $(srctree)/$(src)/$(f)),$(f))) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 1b6094a13034..750d6d5225af 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -35,27 +35,27 @@ subdir-ccflags-y := # Read auto.conf if it exists, otherwise ignore -include include/config/auto.conf -include scripts/Kbuild.include +include $(srctree)/scripts/Kbuild.include # The filename Kbuild has precedence over Makefile kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile) include $(kbuild-file) -include scripts/Makefile.lib +include $(srctree)/scripts/Makefile.lib # Do not include hostprogs rules unless needed. # $(sort ...) is used here to remove duplicated words and excessive spaces. hostprogs := $(sort $(hostprogs)) ifneq ($(hostprogs),) -include scripts/Makefile.host +include $(srctree)/scripts/Makefile.host endif # Do not include userprogs rules unless needed. # $(sort ...) is used here to remove duplicated words and excessive spaces. userprogs := $(sort $(userprogs)) ifneq ($(userprogs),) -include scripts/Makefile.userprogs +include $(srctree)/scripts/Makefile.userprogs endif ifndef obj diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean index 22a8172bce1f..fd6175322470 100644 --- a/scripts/Makefile.clean +++ b/scripts/Makefile.clean @@ -8,7 +8,7 @@ src := $(obj) PHONY := __clean __clean: -include scripts/Kbuild.include +include $(srctree)/scripts/Kbuild.include # The filename Kbuild has precedence over Makefile kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst index ba01f5ba2517..190d781e84f4 100644 --- a/scripts/Makefile.dtbinst +++ b/scripts/Makefile.dtbinst @@ -14,7 +14,7 @@ PHONY := __dtbs_install __dtbs_install: include include/config/auto.conf -include scripts/Kbuild.include +include $(srctree)/scripts/Kbuild.include include $(src)/Makefile dtbs := $(addprefix $(dst)/, $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-))) diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst index 708fbd08a2c5..029d85bb0b23 100644 --- a/scripts/Makefile.headersinst +++ b/scripts/Makefile.headersinst @@ -12,7 +12,7 @@ PHONY := __headers __headers: -include scripts/Kbuild.include +include $(srctree)/scripts/Kbuild.include src := $(srctree)/$(obj) gen := $(objtree)/$(subst include/,include/generated/,$(obj)) diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst index 5a4579e76485..ad1981233d0b 100644 --- a/scripts/Makefile.modinst +++ b/scripts/Makefile.modinst @@ -6,7 +6,7 @@ PHONY := __modinst __modinst: -include scripts/Kbuild.include +include $(srctree)/scripts/Kbuild.include modules := $(sort $(shell cat $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)modules.order)) diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 066beffca09a..df57e259fac3 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -41,10 +41,10 @@ PHONY := __modpost __modpost: include include/config/auto.conf -include scripts/Kbuild.include +include $(srctree)/scripts/Kbuild.include # for ld_flags -include scripts/Makefile.lib +include $(srctree)/scripts/Makefile.lib MODPOST = scripts/mod/modpost \ $(if $(CONFIG_MODVERSIONS),-m) \ diff --git a/scripts/Makefile.modsign b/scripts/Makefile.modsign index d7325cefe709..ddf9b5ca77d7 100644 --- a/scripts/Makefile.modsign +++ b/scripts/Makefile.modsign @@ -6,7 +6,7 @@ PHONY := __modsign __modsign: -include scripts/Kbuild.include +include $(srctree)/scripts/Kbuild.include modules := $(sort $(shell cat modules.order)) -- 2.27.0