kbuild: use $(src) instead of $(srctree)/$(src) for source directory

JIRA: https://issues.redhat.com/browse/RHEL-107194

commit b1992c3772e69a6fd0e3fc81cd4d2820c8b6eca0
Author: Masahiro Yamada <masahiroy@kernel.org>
Date:   Sat Apr 27 23:55:02 2024 +0900

    kbuild: use $(src) instead of $(srctree)/$(src) for source directory

    Kbuild conventionally uses $(obj)/ for generated files, and $(src)/ for
    checked-in source files. It is merely a convention without any functional
    difference. In fact, $(obj) and $(src) are exactly the same, as defined
    in scripts/Makefile.build:

        src := $(obj)

    When the kernel is built in a separate output directory, $(src) does
    not accurately reflect the source directory location. While Kbuild
    resolves this discrepancy by specifying VPATH=$(srctree) to search for
    source files, it does not cover all cases. For example, when adding a
    header search path for local headers, -I$(srctree)/$(src) is typically
    passed to the compiler.

    This introduces inconsistency between upstream and downstream Makefiles
    because $(src) is used instead of $(srctree)/$(src) for the latter.

    To address this inconsistency, this commit changes the semantics of
    $(src) so that it always points to the directory in the source tree.

    Going forward, the variables used in Makefiles will have the following
    meanings:

      $(obj)     - directory in the object tree
      $(src)     - directory in the source tree  (changed by this commit)
      $(objtree) - the top of the kernel object tree
      $(srctree) - the top of the kernel source tree

    Consequently, $(srctree)/$(src) in upstream Makefiles need to be replaced
    with $(src).

    Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
    Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>

Conflicts:

There is a extensive list of fixes/conflicts due the amount of files originally
changed by this commit, plus the difference of rhel-9 code against upstream. All
conflicts/differences are listed below:

- Context difference at Documentation/Makefile since RHEL 9 does not have the
  change "docs: allow to pass extra DOCS_CSS themes via make" and later changes.
- Conflict at Documentation/devicetree/bindings/Makefile, patch find_cmd instead
  of find_all_cmd since RHEL-9 doesn't have "dt-bindings: Consider
  DT_SCHEMA_FILES when finding all json-schema", "dt-bindings: kbuild: Split
  targets out to separate rules" and later changes.
- Conflict at Documentation/kbuild/makefiles.rst due different identation since
  RHEL-9 doesn't have the change "docs/kbuild/makefiles: clean up indentation
  and whitespace"
- Patched additional $(srctree)/$(src) references at:
   * arch/arm/mach-davinci/Makefile
   * arch/arm/mach-omap2/Makefile
   * arch/arm/mach-spear/Makefile
   * arch/arm/plat-pxa/Makefile
   * arch/arm/plat-versatile/Makefile
   * arch/ia64/kernel/Makefile
   * arch/nds32/boot/Makefile
   * arch/nds32/kernel/vdso/Makefile
   * drivers/net/ethernet/hisilicon/hns3/hns3pf/Makefile
   * drivers/net/ethernet/hisilicon/hns3/hns3vf/Makefile
   * drivers/staging/rtl8188eu/Makefile
   * drivers/staging/unisys/visorhba/Makefile
   * drivers/staging/unisys/visornic/Makefile
   * scripts/gcc-plugins/Makefile
  Since RHEL-9 does not have later upstream changes that dropped/made those
  references uneeded.
- Conflict at arch/arm/mach-s3c/Makefile since RHEL-9 doesn't have
  "ARM: s3c: remove s3c24xx specific hacks" and related changes. Also,
  extra locations needed patching because of not having the changes
  "ARM: s3c: remove all s3c24xx support" and "ARM: s3c: fix include path".
  Due lacking the last change also arch/arm/mach-s3c/Makefile.s3c64xx needs
  additional two places patched as well.
- Conflict at arch/arm/plat-orion/Makefile since RHEL-9 doesn't have
  the commit "ARM: orion: fix include path" and its previous related
  changes.
- Dropped changes for arch/loongarch since it doesn't exist on rhel-9
- Dropped changes to arch/parisc/kernel/{vdso32,vdso64}/Makefile since RHEL 9
  does not have the change "parisc: Add vDSO support" and later updates to it.
- Dropped change to arch/riscv/kernel/compat_vdso/Makefile since RHEL 9 does
  not have the change "riscv: compat: vdso: Add COMPAT_VDSO base code implementation"
- Dropped change to arch/riscv/kvm/Makefile since there is no KVM support/commits
  in RHEL 9 for riscv.
- Apply change for arch/riscv/kernel/vdso/Makefile in a different place since
  RHEL-9 does not have the change "riscv: explicitly use symbol offsets for VDSO"
  which changed the location of the $(srctree)/$(src) reference
- Dropped change to certs/Makefile related to check-blacklist-hashes.awk since
  that script was only added with commit "certs: Check that builtin blacklist
  hashes are valid" which is not backported/available in RHEL 9 code right now.
- Dropped change to drivers/md/dm-vdo/Makefile since dm-vdo was never backported
  to RHEL-9 main.
- Dropped change to drivers/net/ethernet/fungible/funeth/Makefile since fungible
  ethernet driver/devices code is not available/backported to RHEL-9.
- Fixed conflict at drivers/net/ethernet/hisilicon/hns3/Makefile since RHEL-9
  does not have the change "net: hns3: refactor hns3 makefile to support
  hns3_common module"
- Fixed conflict at drivers/net/wireless/intel/iwlwifi/mvm/Makefile due already
  backported commit "wifi: iwlwifi: mvm: implement link grading"
- Dropped change to init/Makefile since we are not backporting
  "kbuild: build init/built-in.a just once" that introduced the section patched.
- Dropped change to rust/Makefile since there is no rust support backported
  to RHEL-9.
- Fixed conflict at scripts/dtc/Makefile since RHEL-9 does not have the change
  "dt-bindings: kbuild: Use DTB files for validation"
- Dropped change to security/tomoyo/Makefile since it's not needed, it's just
  reverting the change "tomoyo: fix broken dependency on *.conf.default" which
  was never applied to RHEL-9. However, we also bring a different change/patch
  location since RHEL-9 does not have the change "tomoyo: Omit use of bin2c".
- Dropped change to usr/include/Makefile since "kbuild: move headers_check.pl to
  usr/include/" is not being backported to RHEL-9.
- Misc/minor context differences at other places.

Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
This commit is contained in:
Herton R. Krzesinski 2025-08-14 19:50:14 -03:00
parent 5332bc5fc0
commit a1b9805d99
106 changed files with 178 additions and 187 deletions

View File

@ -68,22 +68,22 @@ loop_cmd = $(echo-cmd) $(cmd_$(1)) || exit;
# * dest folder relative to $(BUILDDIR) and
# * cache folder relative to $(BUILDDIR)/.doctrees
# $4 dest subfolder e.g. "man" for man pages at userspace-api/media/man
# $5 reST source folder relative to $(srctree)/$(src),
# $5 reST source folder relative to $(src),
# e.g. "userspace-api/media" for the linux-tv book-set at ./Documentation/userspace-api/media
quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4)
cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/userspace-api/media $2 && \
PYTHONDONTWRITEBYTECODE=1 \
BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \
BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(src)/$5/$(SPHINX_CONF)) \
$(PYTHON3) $(srctree)/scripts/jobserver-exec \
$(CONFIG_SHELL) $(srctree)/Documentation/sphinx/parallel-wrapper.sh \
$(SPHINXBUILD) \
-b $2 \
-c $(abspath $(srctree)/$(src)) \
-c $(abspath $(src)) \
-d $(abspath $(BUILDDIR)/.doctrees/$3) \
-D version=$(KERNELVERSION) -D release=$(KERNELRELEASE) \
$(ALLSPHINXOPTS) \
$(abspath $(srctree)/$(src)/$5) \
$(abspath $(src)/$5) \
$(abspath $(BUILDDIR)/$3/$4)
YNL_INDEX:=$(srctree)/Documentation/networking/netlink_spec/index.rst

View File

@ -22,17 +22,17 @@ $(obj)/%.example.dts: $(src)/%.yaml check_dtschema_version FORCE
# Use full schemas when checking %.example.dts
DT_TMP_SCHEMA := $(obj)/processed-schema-examples.json
find_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \
find_cmd = find $(src) \( -name '*.yaml' ! \
-name 'processed-schema*' ! \
-name '*.example.dt.yaml' \)
quiet_cmd_yamllint = LINT $(src)
cmd_yamllint = ($(find_cmd) | \
xargs $(DT_SCHEMA_LINT) -f parsable -c $(srctree)/$(src)/.yamllint) || true
xargs $(DT_SCHEMA_LINT) -f parsable -c $(src)/.yamllint) || true
quiet_cmd_chk_bindings = CHKDT $@
cmd_chk_bindings = ($(find_cmd) | \
xargs -n200 -P$$(nproc) $(DT_DOC_CHECKER) -u $(srctree)/$(src)) || true
xargs -n200 -P$$(nproc) $(DT_DOC_CHECKER) -u $(src)) || true
quiet_cmd_mk_schema = SCHEMA $@
cmd_mk_schema = f=$$(mktemp) ; \

View File

@ -421,7 +421,7 @@ more details, with real examples.
Example::
#arch/cris/boot/compressed/Makefile
ldflags-y += -T $(srctree)/$(src)/decompress_$(arch-y).lds
ldflags-y += -T $(src)/decompress_$(arch-y).lds
subdir-ccflags-y, subdir-asflags-y
The two flags listed above are similar to ccflags-y and asflags-y.
@ -502,14 +502,14 @@ more details, with real examples.
Two variables are used when defining custom rules:
$(src)
$(src) is a relative path which points to the directory
where the Makefile is located. Always use $(src) when
$(src) is the directory where the Makefile is located. Always use $(src) when
referring to files located in the src tree.
$(obj)
$(obj) is a relative path which points to the directory
where the target is saved. Always use $(obj) when
referring to generated files.
$(obj) is the directory where the target is saved. Always use $(obj) when
referring to generated files. Use $(obj) for pattern rules that need to work
for both generated files and real sources (VPATH will help to find the
prerequisites not only in the object tree but also in the source tree).
Example::

View File

@ -264,7 +264,14 @@ srctree := $(abs_srctree)
endif
objtree := .
VPATH :=
ifeq ($(KBUILD_EXTMOD),)
ifdef building_out_of_srctree
VPATH := $(srctree)
endif
endif
export building_out_of_srctree srctree objtree VPATH

View File

@ -10,8 +10,7 @@ obj-y += $(builtindtb-y).dtb.o
dtb-y := $(builtindtb-y).dtb
# for CONFIG_OF_ALL_DTBS test
dtstree := $(srctree)/$(src)
dtb- := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts))
dtb- := $(patsubst $(src)/%.dts,%.dtb, $(wildcard $(src)/*.dts))
# board-specific dtc flags
DTC_FLAGS_hsdk += --pad 20

View File

@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_FPE_NWFPE) += nwfpe/
# Put arch/arm/fastfpe/ to use this.
obj-$(CONFIG_FPE_FASTFPE) += $(patsubst $(srctree)/$(src)/%,%,$(wildcard $(srctree)/$(src)/fastfpe/))
obj-$(CONFIG_FPE_FASTFPE) += $(patsubst $(src)/%,%,$(wildcard $(src)/fastfpe/))
obj-$(CONFIG_VFP) += vfp/
obj-$(CONFIG_XEN) += xen/
obj-$(CONFIG_VDSO) += vdso/

View File

@ -31,8 +31,7 @@ targets := Image zImage xipImage bootpImage uImage
ifeq ($(CONFIG_XIP_KERNEL),y)
cmd_deflate_xip_data = $(CONFIG_SHELL) -c \
'$(srctree)/$(src)/deflate_xip_data.sh $< $@'
cmd_deflate_xip_data = $(CONFIG_SHELL) -c '$(src)/deflate_xip_data.sh $< $@'
ifeq ($(CONFIG_XIP_DEFLATED_DATA),y)
quiet_cmd_mkxip = XIPZ $@

View File

@ -4,7 +4,7 @@
#
#
ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(src)/include
# Common objects
obj-y := serial.o usb.o common.o sram.o

View File

@ -3,7 +3,7 @@
# Makefile for the linux kernel.
#
ccflags-y := -I$(srctree)/$(src)/include \
ccflags-y := -I$(src)/include \
-I$(srctree)/arch/arm/plat-omap/include
# Common support

View File

@ -2,14 +2,14 @@
#
# Copyright 2009 Simtec Electronics
ccflags-$(CONFIG_ARCH_MULTIPLATFORM) += -I$(srctree)/$(src)/include
ccflags-$(CONFIG_ARCH_MULTIPLATFORM) += -I$(src)/include
ifdef CONFIG_ARCH_S3C24XX
include $(srctree)/$(src)/Makefile.s3c24xx
include $(src)/Makefile.s3c24xx
endif
ifdef CONFIG_ARCH_S3C64XX
include $(srctree)/$(src)/Makefile.s3c64xx
include $(src)/Makefile.s3c64xx
endif
# Objects we always build independent of SoC choice

View File

@ -3,8 +3,8 @@
# Copyright 2008 Openmoko, Inc.
# Copyright 2008 Simtec Electronics
ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
asflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(src)/include
asflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(src)/include
# PM

View File

@ -3,7 +3,7 @@
# SPEAr Platform specific Makefile
#
ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(src)/include
# Common support
obj-y := restart.o time.o

View File

@ -2,7 +2,7 @@
#
# Makefile for the linux kernel.
#
ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(src)/include
orion-gpio-$(CONFIG_GPIOLIB) += gpio.o
obj-$(CONFIG_PLAT_ORION_LEGACY) += irq.o pcie.o time.o common.o mpp.o

View File

@ -2,7 +2,7 @@
#
# Makefile for code common across different PXA processor families
#
ccflags-$(CONFIG_ARCH_MMP) := -I$(srctree)/$(src)/include
ccflags-$(CONFIG_ARCH_MMP) := -I$(src)/include
obj-$(CONFIG_PXA3xx) += mfp.o
obj-$(CONFIG_ARCH_MMP) += mfp.o

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include
ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(src)/include
obj-$(CONFIG_SMP) += headsmp.o platsmp.o
obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o

View File

@ -9,7 +9,7 @@ gen := arch/$(ARCH)/include/generated
kapi := $(gen)/asm
uapi := $(gen)/uapi/asm
syshdr := $(srctree)/scripts/syscallhdr.sh
sysnr := $(srctree)/$(src)/syscallnr.sh
sysnr := $(src)/syscallnr.sh
systbl := $(srctree)/scripts/syscalltbl.sh
syscall := $(src)/syscall.tbl

View File

@ -68,7 +68,7 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE
$(call if_changed,objcopy)
# Generate VDSO offsets using helper script
gen-vdsosym := $(srctree)/$(src)/gen_vdso_offsets.sh
gen-vdsosym := $(src)/gen_vdso_offsets.sh
quiet_cmd_vdsosym = VDSOSYM $@
cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@

View File

@ -3,7 +3,7 @@
# Makefile for Kernel-based Virtual Machine module
#
ccflags-y += -I $(srctree)/$(src)
ccflags-y += -I $(src)
include $(srctree)/virt/kvm/Makefile.kvm
@ -34,7 +34,7 @@ define rule_gen_hyp_constants
$(call filechk,offsets,__HYP_CONSTANTS_H__)
endef
CFLAGS_hyp-constants.o = -I $(srctree)/$(src)/hyp/include
CFLAGS_hyp-constants.o = -I $(src)/hyp/include
$(obj)/hyp-constants.s: $(src)/hyp/hyp-constants.c FORCE
$(call if_changed_dep,cc_s_c)

View File

@ -3,7 +3,7 @@
# Makefile for Kernel-based Virtual Machine module, HYP part
#
incdir := $(srctree)/$(src)/include
incdir := $(src)/include
subdir-asflags-y := -I$(incdir)
subdir-ccflags-y := -I$(incdir)

View File

@ -1,4 +1,2 @@
# SPDX-License-Identifier: GPL-2.0-only
dtstree := $(srctree)/$(src)
dtb-y := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts))
dtb-y := $(patsubst $(src)/%.dts,%.dtb, $(wildcard $(src)/*.dts))

View File

@ -57,7 +57,7 @@ quiet_cmd_vdsold = VDSOLD $@
# Extracts symbol offsets from the VDSO, converting them into an assembly file
# that contains the same symbols at the same offsets.
quiet_cmd_so2s = SO2S $@
cmd_so2s = $(NM) -D $< | $(srctree)/$(src)/so2s.sh > $@
cmd_so2s = $(NM) -D $< | $(src)/so2s.sh > $@
# install commands for the unstripped file
quiet_cmd_vdso_install = INSTALL $@

View File

@ -46,4 +46,4 @@ obj-$(CONFIG_ELF_CORE) += elfcore.o
CFLAGS_traps.o += -mfixed-range=f2-f5,f16-f31
# The gate DSO image is built using a special linker script.
include $(srctree)/$(src)/Makefile.gate
include $(src)/Makefile.gate

View File

@ -5,7 +5,7 @@ uapi := arch/$(SRCARCH)/include/generated/uapi/asm
$(shell mkdir -p $(uapi) $(kapi))
syshdr := $(srctree)/scripts/syscallhdr.sh
sysnr := $(srctree)/$(src)/syscallnr.sh
sysnr := $(src)/syscallnr.sh
systbl := $(srctree)/scripts/syscalltbl.sh
quiet_cmd_syshdr = SYSHDR $@

View File

@ -40,8 +40,8 @@ CFLAGS_vgettimeofday.o = -include $(c-gettimeofday-y)
# config-n32-o32-env.c prepares the environment to build a 32bit vDSO
# library on a 64bit kernel.
# Note: Needs to be included before than the generic library.
CFLAGS_vgettimeofday-o32.o = -include $(srctree)/$(src)/config-n32-o32-env.c -include $(c-gettimeofday-y)
CFLAGS_vgettimeofday-n32.o = -include $(srctree)/$(src)/config-n32-o32-env.c -include $(c-gettimeofday-y)
CFLAGS_vgettimeofday-o32.o = -include $(src)/config-n32-o32-env.c -include $(c-gettimeofday-y)
CFLAGS_vgettimeofday-n32.o = -include $(src)/config-n32-o32-env.c -include $(c-gettimeofday-y)
endif
CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE)

View File

@ -8,9 +8,9 @@ $(obj)/Image.gz: $(obj)/Image FORCE
$(call if_changed,gzip)
install: $(obj)/Image
$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
$(CONFIG_SHELL) $(src)/install.sh $(KERNELRELEASE) \
$(obj)/Image System.map "$(INSTALL_PATH)"
zinstall: $(obj)/Image.gz
$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
$(CONFIG_SHELL) $(src)/install.sh $(KERNELRELEASE) \
$(obj)/Image.gz System.map "$(INSTALL_PATH)"

View File

@ -37,7 +37,7 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE
$(call if_changed,objcopy)
# Generate VDSO offsets using helper script
gen-vdsosym := $(srctree)/$(src)/gen_vdso_offsets.sh
gen-vdsosym := $(src)/gen_vdso_offsets.sh
quiet_cmd_vdsosym = VDSOSYM $@
cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@

View File

@ -2,5 +2,4 @@
obj-y := $(patsubst "%.dts",%.dtb.o,$(CONFIG_NIOS2_DTB_SOURCE))
dtstree := $(srctree)/$(src)
dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts))
dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(src)/%.dts,%.dtb, $(wildcard $(src)/*.dts))

View File

@ -199,7 +199,7 @@ $(addprefix $(obj)/,$(libfdt) $(libfdtheader)): $(obj)/%: $(srctree)/scripts/dtc
$(obj)/empty.c:
$(Q)touch $@
$(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds : $(obj)/%: $(srctree)/$(src)/%.S
$(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds : $(obj)/%: $(src)/%.S
$(Q)cp $< $@
clean-files := $(zlib-) $(zlibheader-) $(zliblinuxheader-) \
@ -233,9 +233,9 @@ targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a) zImage.lds
extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
$(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds
dtstree := $(srctree)/$(src)/dts
dtstree := $(src)/dts
wrapper :=$(srctree)/$(src)/wrapper
wrapper := $(src)/wrapper
wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \
$(wrapper) FORCE

View File

@ -2,5 +2,4 @@
subdir-y += fsl
dtstree := $(srctree)/$(src)
dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts))
dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(src)/%.dts,%.dtb, $(wildcard $(src)/*.dts))

View File

@ -1,4 +1,3 @@
# SPDX-License-Identifier: GPL-2.0
dtstree := $(srctree)/$(src)
dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts))
dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(src)/%.dts,%.dtb, $(wildcard $(src)/*.dts))

View File

@ -77,10 +77,10 @@ $(obj)/vgettimeofday-64.o: %-64.o: %.c FORCE
$(call if_changed_dep,cc_o_c)
# Generate VDSO offsets using helper script
gen-vdso32sym := $(srctree)/$(src)/gen_vdso32_offsets.sh
gen-vdso32sym := $(src)/gen_vdso32_offsets.sh
quiet_cmd_vdso32sym = VDSO32SYM $@
cmd_vdso32sym = $(NM) $< | $(gen-vdso32sym) | LC_ALL=C sort > $@
gen-vdso64sym := $(srctree)/$(src)/gen_vdso64_offsets.sh
gen-vdso64sym := $(src)/gen_vdso64_offsets.sh
quiet_cmd_vdso64sym = VDSO64SYM $@
cmd_vdso64sym = $(NM) $< | $(gen-vdso64sym) | LC_ALL=C sort > $@

View File

@ -66,7 +66,7 @@ quiet_cmd_vdsold = VDSOLD $@
# Extracts symbol offsets from the VDSO, converting them into an assembly file
# that contains the same symbols at the same offsets.
quiet_cmd_so2s = SO2S $@
cmd_so2s = $(NM) -D $< | $(srctree)/$(src)/so2s.sh > $@
cmd_so2s = $(NM) -D $< | $(src)/so2s.sh > $@
# install commands for the unstripped file
quiet_cmd_vdso_install = INSTALL $@

View File

@ -4,8 +4,8 @@ gen := arch/$(ARCH)/include/generated
kapi := $(gen)/asm
uapi := $(gen)/uapi/asm
syscall := $(srctree)/$(src)/syscall.tbl
systbl := $(srctree)/$(src)/syscalltbl
syscall := $(src)/syscall.tbl
systbl := $(src)/syscalltbl
gen-y := $(kapi)/syscall_table.h
kapi-hdrs-y := $(kapi)/unistd_nr.h

View File

@ -74,7 +74,7 @@ vdso32.so: $(obj)/vdso32.so.dbg
vdso_install: vdso32.so
# Generate VDSO offsets using helper script
gen-vdsosym := $(srctree)/$(src)/gen_vdso_offsets.sh
gen-vdsosym := $(src)/gen_vdso_offsets.sh
quiet_cmd_vdsosym = VDSOSYM $@
cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@

View File

@ -84,7 +84,7 @@ vdso64.so: $(obj)/vdso64.so.dbg
vdso_install: vdso64.so
# Generate VDSO offsets using helper script
gen-vdsosym := $(srctree)/$(src)/gen_vdso_offsets.sh
gen-vdsosym := $(src)/gen_vdso_offsets.sh
quiet_cmd_vdsosym = VDSOSYM $@
cmd_vdsosym = $(NM) $< | $(gen-vdsosym) | LC_ALL=C sort > $@

View File

@ -112,7 +112,7 @@ quiet_cmd_vdso = VDSO $@
cmd_vdso = $(LD) -nostdlib -o $@ \
$(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \
-T $(filter %.lds,$^) $(filter %.o,$^) && \
sh $(srctree)/$(src)/checkundef.sh '$(OBJDUMP)' '$@'
sh $(src)/checkundef.sh '$(OBJDUMP)' '$@'
VDSO_LDFLAGS = -shared --hash-style=both --build-id=sha1 -Bsymbolic
GCOV_PROFILE := n

View File

@ -45,7 +45,7 @@ $(obj)/config.c: $(src)/config.c.in $(obj)/config.tmp FORCE
$(call if_changed,quote2)
quiet_cmd_mkcapflags = MKCAP $@
cmd_mkcapflags = $(CONFIG_SHELL) $(srctree)/$(src)/../../x86/kernel/cpu/mkcapflags.sh $@ $^
cmd_mkcapflags = $(CONFIG_SHELL) $(src)/../../x86/kernel/cpu/mkcapflags.sh $@ $^
cpufeature = $(src)/../../x86/include/asm/cpufeatures.h
vmxfeature = $(src)/../../x86/include/asm/vmxfeatures.h

View File

@ -129,7 +129,7 @@ targets += mtools.conf
# genimage.sh requires bash, but it also has a bunch of other
# external dependencies.
quiet_cmd_genimage = GENIMAGE $3
cmd_genimage = $(BASH) $(srctree)/$(src)/genimage.sh $2 $3 $(obj)/bzImage \
cmd_genimage = $(BASH) $(src)/genimage.sh $2 $3 $(obj)/bzImage \
$(obj)/mtools.conf '$(FDARGS)' $(FDINITRD)
PHONY += bzdisk fdimage fdimage144 fdimage288 hdimage isoimage

View File

@ -185,7 +185,7 @@ quiet_cmd_vdso = VDSO $@
cmd_vdso = $(LD) -o $@ \
$(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \
-T $(filter %.lds,$^) $(filter %.o,$^) && \
sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
sh $(src)/checkundef.sh '$(NM)' '$@'
VDSO_LDFLAGS = -shared --hash-style=both --build-id=sha1 \
$(call ld-option, --eh-frame-hdr) -Bsymbolic -z noexecstack

View File

@ -40,7 +40,7 @@ KMSAN_SANITIZE_nmi.o := n
# first second.
KCOV_INSTRUMENT_head$(BITS).o := n
CFLAGS_irq.o := -I $(srctree)/$(src)/../include/asm/trace
CFLAGS_irq.o := -I $(src)/../include/asm/trace
obj-y += process_$(BITS).o signal.o signal_$(BITS).o
obj-y += traps.o idt.o irq.o irq_$(BITS).o dumpstack_$(BITS).o

View File

@ -60,7 +60,7 @@ obj-$(CONFIG_ACRN_GUEST) += acrn.o
obj-$(CONFIG_DEBUG_FS) += debugfs.o
quiet_cmd_mkcapflags = MKCAP $@
cmd_mkcapflags = $(CONFIG_SHELL) $(srctree)/$(src)/mkcapflags.sh $@ $^
cmd_mkcapflags = $(CONFIG_SHELL) $(src)/mkcapflags.sh $@ $^
cpufeature = $(src)/../../include/asm/cpufeatures.h
vmxfeature = $(src)/../../include/asm/vmxfeatures.h

View File

@ -34,7 +34,7 @@ obj-y += pat/
CFLAGS_physaddr.o := -fno-stack-protector
CFLAGS_mem_encrypt_identity.o := -fno-stack-protector
CFLAGS_fault.o := -I $(srctree)/$(src)/../include/asm/trace
CFLAGS_fault.o := -I $(src)/../include/asm/trace
obj-$(CONFIG_X86_32) += pgtable_32.o iomap_32.o

View File

@ -63,7 +63,7 @@ quiet_cmd_vdso = VDSO $@
cmd_vdso = $(CC) -nostdlib -o $@ \
$(CC_FLAGS_LTO) $(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \
-Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \
sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
sh $(src)/checkundef.sh '$(NM)' '$@'
VDSO_LDFLAGS = -fPIC -shared -Wl,--hash-style=sysv -z noexecstack
GCOV_PROFILE := n

View File

@ -13,5 +13,4 @@ obj-$(CONFIG_OF) += $(BUILTIN_DTB_SOURCE)
endif
# for CONFIG_OF_ALL_DTBS test
dtstree := $(srctree)/$(src)
dtb- := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts))
dtb- := $(patsubst $(src)/%.dts,%.dtb, $(wildcard $(src)/*.dts))

View File

@ -102,7 +102,7 @@ $(obj)/signing_key.pem: $(obj)/x509.genkey
@$(kecho) "###"
quiet_cmd_copy_x509_config = COPY $@
cmd_copy_x509_config = cat $(srctree)/$(src)/default_x509.genkey > $@
cmd_copy_x509_config = cat $(src)/default_x509.genkey > $@
# You can provide your own config file. If not present, copy the default one.
$(obj)/x509.genkey:

View File

@ -6,11 +6,6 @@
# Rewritten to use lists instead of if-statements.
#
# Some driver Makefiles miss $(srctree)/ for include directive.
ifdef building_out_of_srctree
MAKEFLAGS += --include-dir=$(srctree)
endif
obj-y += irqchip/
obj-y += bus/

View File

@ -1,4 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-only
ccflags-y := -I $(srctree)/$(src)/../qat_common
ccflags-y := -I $(src)/../qat_common
obj-$(CONFIG_CRYPTO_DEV_QAT_420XX) += qat_420xx.o
qat_420xx-y := adf_drv.o adf_420xx_hw_data.o

View File

@ -1,4 +1,4 @@
# SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only)
ccflags-y := -I $(srctree)/$(src)/../qat_common
ccflags-y := -I $(src)/../qat_common
obj-$(CONFIG_CRYPTO_DEV_QAT_4XXX) += qat_4xxx.o
qat_4xxx-y := adf_drv.o adf_4xxx_hw_data.o

View File

@ -1,4 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-only
ccflags-y := -I $(srctree)/$(src)/../qat_common
ccflags-y := -I $(src)/../qat_common
obj-$(CONFIG_CRYPTO_DEV_QAT_C3XXX) += qat_c3xxx.o
qat_c3xxx-y := adf_drv.o adf_c3xxx_hw_data.o

View File

@ -1,4 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-only
ccflags-y := -I $(srctree)/$(src)/../qat_common
ccflags-y := -I $(src)/../qat_common
obj-$(CONFIG_CRYPTO_DEV_QAT_C3XXXVF) += qat_c3xxxvf.o
qat_c3xxxvf-y := adf_drv.o adf_c3xxxvf_hw_data.o

View File

@ -1,4 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-only
ccflags-y := -I $(srctree)/$(src)/../qat_common
ccflags-y := -I $(src)/../qat_common
obj-$(CONFIG_CRYPTO_DEV_QAT_C62X) += qat_c62x.o
qat_c62x-y := adf_drv.o adf_c62x_hw_data.o

View File

@ -1,4 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-only
ccflags-y := -I $(srctree)/$(src)/../qat_common
ccflags-y := -I $(src)/../qat_common
obj-$(CONFIG_CRYPTO_DEV_QAT_C62XVF) += qat_c62xvf.o
qat_c62xvf-y := adf_drv.o adf_c62xvf_hw_data.o

View File

@ -1,4 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-only
ccflags-y := -I $(srctree)/$(src)/../qat_common
ccflags-y := -I $(src)/../qat_common
obj-$(CONFIG_CRYPTO_DEV_QAT_DH895xCC) += qat_dh895xcc.o
qat_dh895xcc-y := adf_drv.o adf_dh895xcc_hw_data.o

View File

@ -1,4 +1,4 @@
# SPDX-License-Identifier: GPL-2.0-only
ccflags-y := -I $(srctree)/$(src)/../qat_common
ccflags-y := -I $(src)/../qat_common
obj-$(CONFIG_CRYPTO_DEV_QAT_DH895xCCVF) += qat_dh895xccvf.o
qat_dh895xccvf-y := adf_drv.o adf_dh895xccvf_hw_data.o

View File

@ -23,7 +23,7 @@
# Makefile for the drm device driver. This driver provides support for the
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
FULL_AMD_PATH=$(srctree)/$(src)/..
FULL_AMD_PATH=$(src)/..
DISPLAY_FOLDER_NAME=display
FULL_AMD_DISPLAY_PATH = $(FULL_AMD_PATH)/$(DISPLAY_FOLDER_NAME)

View File

@ -1,8 +1,8 @@
# SPDX-License-Identifier: GPL-2.0
ccflags-y := \
-I $(srctree)/$(src)/../include \
-I $(srctree)/$(src)
-I $(src)/../include \
-I $(src)
komeda-y := \
komeda_drv.o \

View File

@ -13,7 +13,7 @@ subdir-ccflags-$(CONFIG_DRM_I915_WERROR) += -Werror
# drivers. Define I915 when building i915.
subdir-ccflags-y += -DI915
subdir-ccflags-y += -I$(srctree)/$(src)
subdir-ccflags-y += -I$(src)
# Please keep these build lists sorted!
@ -419,7 +419,7 @@ no-header-test := \
always-$(CONFIG_DRM_I915_WERROR) += \
$(patsubst %.h,%.hdrtest, $(filter-out $(no-header-test), \
$(shell cd $(srctree)/$(src) && find * -name '*.h')))
$(shell cd $(src) && find * -name '*.h')))
quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
cmd_hdrtest = $(CC) $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; \

View File

@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only OR MIT
# Copyright (c) 2023 Imagination Technologies Ltd.
subdir-ccflags-y := -I$(srctree)/$(src)
subdir-ccflags-y := -I$(src)
powervr-y := \
pvr_ccb.o \

View File

@ -1,8 +1,8 @@
# SPDX-License-Identifier: GPL-2.0
ccflags-y := -I $(srctree)/$(src)
ccflags-y += -I $(srctree)/$(src)/disp/dpu1
ccflags-$(CONFIG_DRM_MSM_DSI) += -I $(srctree)/$(src)/dsi
ccflags-$(CONFIG_DRM_MSM_DP) += -I $(srctree)/$(src)/dp
ccflags-y := -I $(src)
ccflags-y += -I $(src)/disp/dpu1
ccflags-$(CONFIG_DRM_MSM_DSI) += -I $(src)/dsi
ccflags-$(CONFIG_DRM_MSM_DP) += -I $(src)/dp
msm-y := \
adreno/adreno_device.o \

View File

@ -1,10 +1,8 @@
NOUVEAU_PATH ?= $(srctree)
# SPDX-License-Identifier: MIT
ccflags-y += -I $(NOUVEAU_PATH)/$(src)/include
ccflags-y += -I $(NOUVEAU_PATH)/$(src)/include/nvkm
ccflags-y += -I $(NOUVEAU_PATH)/$(src)/nvkm
ccflags-y += -I $(NOUVEAU_PATH)/$(src)
ccflags-y += -I $(src)/include
ccflags-y += -I $(src)/include/nvkm
ccflags-y += -I $(src)/nvkm
ccflags-y += -I $(src)
# NVKM - HW resource manager
#- code also used by various userspace tools/tests

View File

@ -9,7 +9,7 @@ subdir-ccflags-y += $(call cc-option, -Wformat-truncation)
# Enable -Werror in CI and development
subdir-ccflags-$(CONFIG_DRM_XE_WERROR) += -Werror
subdir-ccflags-y += -I$(obj) -I$(srctree)/$(src)
subdir-ccflags-y += -I$(obj) -I$(src)
# generated sources
@ -18,7 +18,7 @@ generated_oob := $(obj)/generated/xe_wa_oob.c $(obj)/generated/xe_wa_oob.h
quiet_cmd_wa_oob = GEN $(notdir $(generated_oob))
cmd_wa_oob = mkdir -p $(@D); $^ $(generated_oob)
$(obj)/generated/%_wa_oob.c $(obj)/generated/%_wa_oob.h: $(obj)/xe_gen_wa_oob \
$(srctree)/$(src)/xe_wa_oob.rules
$(src)/xe_wa_oob.rules
$(call cmd,wa_oob)
# Please keep these build lists sorted!
@ -161,8 +161,8 @@ endif
# i915 Display compat #defines and #includes
subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \
-I$(srctree)/$(src)/display/ext \
-I$(srctree)/$(src)/compat-i915-headers \
-I$(src)/display/ext \
-I$(src)/compat-i915-headers \
-I$(srctree)/drivers/gpu/drm/i915/display/ \
-Ddrm_i915_private=xe_device
@ -327,7 +327,7 @@ ifneq ($(CONFIG_DRM_XE_DISPLAY),y)
endif
always-$(CONFIG_DRM_XE_WERROR) += \
$(patsubst %.h,%.hdrtest, $(shell cd $(srctree)/$(src) && find * -name '*.h' $(hdrtest_find_args)))
$(patsubst %.h,%.hdrtest, $(shell cd $(src) && find * -name '*.h' $(hdrtest_find_args)))
quiet_cmd_hdrtest = HDRTEST $(patsubst %.hdrtest,%.h,$@)
cmd_hdrtest = $(CC) -DHDRTEST $(filter-out $(CFLAGS_GCOV), $(c_flags)) -S -o /dev/null -x c /dev/null -include $<; touch $@

View File

@ -13,4 +13,4 @@ amd_sfh-objs += sfh1_1/amd_sfh_init.o
amd_sfh-objs += sfh1_1/amd_sfh_interface.o
amd_sfh-objs += sfh1_1/amd_sfh_desc.o
ccflags-y += -I $(srctree)/$(src)/
ccflags-y += -I $(src)/

View File

@ -24,4 +24,4 @@ intel-ishtp-hid-objs += ishtp-hid-client.o
obj-$(CONFIG_INTEL_ISH_FIRMWARE_DOWNLOADER) += intel-ishtp-loader.o
intel-ishtp-loader-objs += ishtp-fw-loader.o
ccflags-y += -I $(srctree)/$(src)/ishtp
ccflags-y += -I $(src)/ishtp

View File

@ -8,7 +8,7 @@
obj-$(CONFIG_AQTION) += atlantic.o
ccflags-y += -I$(srctree)/$(src)
ccflags-y += -I$(src)
atlantic-objs := aq_main.o \
aq_nic.o \

View File

@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-only
ccflags-y := -I $(srctree)/$(src)/../cxgb4
ccflags-y := -I $(src)/../cxgb4
obj-$(CONFIG_CHELSIO_LIB) += libcxgb.o

View File

@ -3,7 +3,7 @@
# Makefile for the HISILICON network device drivers.
#
ccflags-y += -I$(srctree)/$(src)
ccflags-y += -I$(src)
obj-$(CONFIG_HNS3) += hns3pf/
obj-$(CONFIG_HNS3) += hns3vf/

View File

@ -4,7 +4,7 @@
#
ccflags-y := -I $(srctree)/drivers/net/ethernet/hisilicon/hns3
ccflags-y += -I $(srctree)/$(src)
ccflags-y += -I $(src)
obj-$(CONFIG_HNS3_HCLGE) += hclge.o
hclge-objs = hclge_main.o hclge_cmd.o hclge_mdio.o hclge_tm.o hclge_mbx.o hclge_err.o hclge_debugfs.o hclge_ptp.o

View File

@ -4,7 +4,7 @@
#
ccflags-y := -I $(srctree)/drivers/net/ethernet/hisilicon/hns3
ccflags-y += -I $(srctree)/$(src)
ccflags-y += -I $(src)
obj-$(CONFIG_HNS3_HCLGEVF) += hclgevf.o
hclgevf-objs = hclgevf_main.o hclgevf_cmd.o hclgevf_mbx.o

View File

@ -6,8 +6,8 @@
#
ccflags-y += \
-I $(srctree)/$(src) \
-I $(srctree)/$(src)/../include
-I $(src) \
-I $(src)/../include
obj-$(CONFIG_BRCMFMAC) += brcmfmac.o
brcmfmac-objs += \

View File

@ -3,9 +3,9 @@
# Copyright (c) 2022 Broadcom Corporation
ccflags-y += \
-I $(srctree)/$(src) \
-I $(srctree)/$(src)/.. \
-I $(srctree)/$(src)/../../include
-I $(src) \
-I $(src)/.. \
-I $(src)/../../include
obj-m += brcmfmac-bca.o
brcmfmac-bca-objs += \

View File

@ -3,9 +3,9 @@
# Copyright (c) 2022 Broadcom Corporation
ccflags-y += \
-I $(srctree)/$(src) \
-I $(srctree)/$(src)/.. \
-I $(srctree)/$(src)/../../include
-I $(src) \
-I $(src)/.. \
-I $(src)/../../include
obj-m += brcmfmac-cyw.o
brcmfmac-cyw-objs += \

View File

@ -3,9 +3,9 @@
# Copyright (c) 2022 Broadcom Corporation
ccflags-y += \
-I $(srctree)/$(src) \
-I $(srctree)/$(src)/.. \
-I $(srctree)/$(src)/../../include
-I $(src) \
-I $(src)/.. \
-I $(src)/../../include
obj-m += brcmfmac-wcc.o
brcmfmac-wcc-objs += \

View File

@ -16,9 +16,9 @@
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
ccflags-y := \
-I $(srctree)/$(src) \
-I $(srctree)/$(src)/phy \
-I $(srctree)/$(src)/../include
-I $(src) \
-I $(src)/phy \
-I $(src)/../include
brcmsmac-y := \
mac80211_if.o \

View File

@ -4,7 +4,7 @@
#
# Copyright (c) 2011 Broadcom Corporation
#
ccflags-y := -I $(srctree)/$(src)/../include
ccflags-y := -I $(src)/../include
obj-$(CONFIG_BRCMUTIL) += brcmutil.o
brcmutil-objs = utils.o d11.o

View File

@ -11,4 +11,4 @@ iwldvm-objs += rxon.o devices.o
iwldvm-$(CONFIG_IWLWIFI_LEDS) += led.o
iwldvm-$(CONFIG_IWLWIFI_DEBUGFS) += debugfs.o
ccflags-y += -I $(srctree)/$(src)/../
ccflags-y += -I $(src)/../

View File

@ -5,4 +5,4 @@ iwlmei-y += net.o
iwlmei-$(CONFIG_IWLWIFI_DEVICE_TRACING) += trace.o
CFLAGS_trace.o := -I$(src)
ccflags-y += -I $(srctree)/$(src)/../
ccflags-y += -I $(src)/../

View File

@ -16,4 +16,4 @@ iwlmvm-$(CONFIG_IWLWIFI_LEDS) += led.o
iwlmvm-$(CONFIG_PM_SLEEP) += d3.o
iwlmvm-$(CONFIG_IWLMEI) += vendor-cmd.o
subdir-ccflags-y += -I $(srctree)/$(src)/../
subdir-ccflags-y += -I $(src)/../

View File

@ -2,6 +2,6 @@
iwlwifi-tests-y += module.o devinfo.o
ccflags-y += -I$(srctree)/$(src)/../
ccflags-y += -I$(src)/../
obj-$(CONFIG_IWLWIFI_KUNIT_TESTS) += iwlwifi-tests.o

View File

@ -3,4 +3,4 @@ rtl818x_pci-objs := dev.o rtl8225.o sa2400.o max2820.o grf5101.o rtl8225se.o
obj-$(CONFIG_RTL8180) += rtl818x_pci.o
ccflags-y += -I $(srctree)/$(src)/..
ccflags-y += -I $(src)/..

View File

@ -3,4 +3,4 @@ rtl8187-objs := dev.o rtl8225.o leds.o rfkill.o
obj-$(CONFIG_RTL8187) += rtl8187.o
ccflags-y += -I $(srctree)/$(src)/..
ccflags-y += -I $(src)/..

View File

@ -55,9 +55,9 @@ aicasm-7xxx-opts-$(CONFIG_AIC7XXX_REG_PRETTY_PRINT) := \
ifeq ($(CONFIG_AIC7XXX_BUILD_FIRMWARE),y)
$(obj)/aic7xxx_seq.h: $(src)/aic7xxx.seq $(src)/aic7xxx.reg $(obj)/aicasm/aicasm
$(obj)/aicasm/aicasm -I$(srctree)/$(src) -r $(obj)/aic7xxx_reg.h \
$(obj)/aicasm/aicasm -I $(src) -r $(obj)/aic7xxx_reg.h \
$(aicasm-7xxx-opts-y) -o $(obj)/aic7xxx_seq.h \
$(srctree)/$(src)/aic7xxx.seq
$(src)/aic7xxx.seq
$(aic7xxx-gen-y): $(objtree)/$(obj)/aic7xxx_seq.h
@true
@ -73,9 +73,9 @@ aicasm-79xx-opts-$(CONFIG_AIC79XX_REG_PRETTY_PRINT) := \
ifeq ($(CONFIG_AIC79XX_BUILD_FIRMWARE),y)
$(obj)/aic79xx_seq.h: $(src)/aic79xx.seq $(src)/aic79xx.reg $(obj)/aicasm/aicasm
$(obj)/aicasm/aicasm -I$(srctree)/$(src) -r $(obj)/aic79xx_reg.h \
$(obj)/aicasm/aicasm -I $(src) -r $(obj)/aic79xx_reg.h \
$(aicasm-79xx-opts-y) -o $(obj)/aic79xx_seq.h \
$(srctree)/$(src)/aic79xx.seq
$(src)/aic79xx.seq
$(aic79xx-gen-y): $(objtree)/$(obj)/aic79xx_seq.h
@true
@ -83,5 +83,5 @@ else
$(obj)/aic79xx_reg_print.c: $(src)/aic79xx_reg_print.c_shipped
endif
$(obj)/aicasm/aicasm: $(srctree)/$(src)/aicasm/*.[chyl]
$(MAKE) -C $(srctree)/$(src)/aicasm OUTDIR=$(shell pwd)/$(obj)/aicasm/
$(obj)/aicasm/aicasm: $(src)/aicasm/*.[chyl]
$(MAKE) -C $(src)/aicasm OUTDIR=$(shell pwd)/$(obj)/aicasm/

View File

@ -53,4 +53,4 @@ r8188eu-y := \
obj-$(CONFIG_R8188EU) := r8188eu.o
ccflags-y += -I$(srctree)/$(src)/include
ccflags-y += -I$(src)/include

View File

@ -65,4 +65,4 @@ r8723bs-y = \
obj-$(CONFIG_RTL8723BS) := r8723bs.o
ccflags-y += -I$(srctree)/$(src)/include -I$(srctree)/$(src)/hal
ccflags-y += -I$(src)/include -I$(src)/hal

View File

@ -7,4 +7,4 @@ obj-$(CONFIG_UNISYS_VISORHBA) += visorhba.o
visorhba-y := visorhba_main.o
ccflags-y += -I $(srctree)/$(src)/../include
ccflags-y += -I $(src)/../include

View File

@ -7,4 +7,4 @@ obj-$(CONFIG_UNISYS_VISORNIC) += visornic.o
visornic-y := visornic_main.o
ccflags-y += -I $(srctree)/$(src)/../include
ccflags-y += -I $(src)/../include

View File

@ -4,7 +4,7 @@
# All Rights Reserved.
#
ccflags-y += -I $(srctree)/$(src) # needed for trace events
ccflags-y += -I $(src) # needed for trace events
obj-$(CONFIG_FS_IOMAP) += iomap.o

View File

@ -15,13 +15,13 @@ ifdef REGENERATE_UTF8DATA
quiet_cmd_utf8data = GEN $@
cmd_utf8data = $< \
-a $(srctree)/$(src)/DerivedAge.txt \
-c $(srctree)/$(src)/DerivedCombiningClass.txt \
-p $(srctree)/$(src)/DerivedCoreProperties.txt \
-d $(srctree)/$(src)/UnicodeData.txt \
-f $(srctree)/$(src)/CaseFolding.txt \
-n $(srctree)/$(src)/NormalizationCorrections.txt \
-t $(srctree)/$(src)/NormalizationTest.txt \
-a $(src)/DerivedAge.txt \
-c $(src)/DerivedCombiningClass.txt \
-p $(src)/DerivedCoreProperties.txt \
-d $(src)/UnicodeData.txt \
-f $(src)/CaseFolding.txt \
-n $(src)/NormalizationCorrections.txt \
-t $(src)/NormalizationTest.txt \
-o $@
$(obj)/utf8data.h: $(obj)/mkutf8data $(filter %.txt, $(cmd_utf8data)) FORCE

View File

@ -4,8 +4,8 @@
# All Rights Reserved.
#
ccflags-y += -I $(srctree)/$(src) # needed for trace events
ccflags-y += -I $(srctree)/$(src)/libxfs
ccflags-y += -I $(src) # needed for trace events
ccflags-y += -I $(src)/libxfs
obj-$(CONFIG_XFS_FS) += xfs.o

View File

@ -339,7 +339,7 @@ $(obj)/oid_registry_data.c: $(srctree)/include/linux/oid_registry.h \
$(call cmd,build_OID_registry)
quiet_cmd_build_OID_registry = GEN $@
cmd_build_OID_registry = perl $(srctree)/$(src)/build_OID_registry $< $@
cmd_build_OID_registry = perl $(src)/build_OID_registry $< $@
clean-files += oid_registry_data.c
@ -394,8 +394,8 @@ obj-$(CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED) += devmem_is_allowed.o
obj-$(CONFIG_FIRMWARE_TABLE) += fw_table.o
# FORTIFY_SOURCE compile-time behavior tests
TEST_FORTIFY_SRCS = $(wildcard $(srctree)/$(src)/test_fortify/*-*.c)
TEST_FORTIFY_LOGS = $(patsubst $(srctree)/$(src)/%.c, %.log, $(TEST_FORTIFY_SRCS))
TEST_FORTIFY_SRCS = $(wildcard $(src)/test_fortify/*-*.c)
TEST_FORTIFY_LOGS = $(patsubst $(src)/%.c, %.log, $(TEST_FORTIFY_SRCS))
TEST_FORTIFY_LOG = test_fortify.log
quiet_cmd_test_fortify = TEST $@

View File

@ -52,7 +52,7 @@ endif
endif
quiet_cmd_unroll = UNROLL $@
cmd_unroll = $(AWK) -v N=$* -f $(srctree)/$(src)/unroll.awk < $< > $@
cmd_unroll = $(AWK) -v N=$* -f $(src)/unroll.awk < $< > $@
targets += int1.c int2.c int4.c int8.c int16.c int32.c
$(obj)/int%.c: $(src)/int.uc $(src)/unroll.awk FORCE

View File

@ -20,7 +20,7 @@ ifneq ($(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR),)
cfg80211-y += extra-certs.o
endif
$(obj)/shipped-certs.c: $(sort $(wildcard $(srctree)/$(src)/certs/*.hex))
$(obj)/shipped-certs.c: $(sort $(wildcard $(src)/certs/*.hex))
@$(kecho) " GEN $@"
$(Q)(echo '#include "reg.h"'; \
echo 'const u8 shipped_regdb_certs[] = {'; \

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
BPF_SAMPLES_PATH ?= $(abspath $(srctree)/$(src))
BPF_SAMPLES_PATH ?= $(abspath $(src))
TOOLS_PATH := $(BPF_SAMPLES_PATH)/../../tools
pound := \#

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0
HID_SAMPLES_PATH ?= $(abspath $(srctree)/$(src))
HID_SAMPLES_PATH ?= $(abspath $(src))
TOOLS_PATH := $(HID_SAMPLES_PATH)/../../tools
pound := \#

View File

@ -58,8 +58,7 @@ stringify = $(squote)$(quote)$1$(quote)$(squote)
###
# The path to Kbuild or Makefile. Kbuild has precedence over Makefile.
kbuild-dir = $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
kbuild-file = $(or $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Makefile)
kbuild-file = $(or $(wildcard $(src)/Kbuild),$(src)/Makefile)
###
# Easy method for doing a status message

View File

@ -9,7 +9,7 @@
PHONY := all
all:
src := $(subst /generated,,$(obj))
src := $(srctree)/$(subst /generated,,$(obj))
include $(srctree)/scripts/Kbuild.include
-include $(kbuild-file)
@ -20,14 +20,14 @@ include $(srctree)/$(generic)/Kbuild
endif
redundant := $(filter $(mandatory-y) $(generated-y), $(generic-y))
redundant += $(foreach f, $(generic-y), $(if $(wildcard $(srctree)/$(src)/$(f)),$(f)))
redundant += $(foreach f, $(generic-y), $(if $(wildcard $(src)/$(f)),$(f)))
redundant := $(sort $(redundant))
$(if $(redundant),\
$(warning redundant generic-y found in $(src)/Kbuild: $(redundant)))
# If arch does not implement mandatory headers, fallback to asm-generic ones.
mandatory-y := $(filter-out $(generated-y), $(mandatory-y))
generic-y += $(foreach f, $(mandatory-y), $(if $(wildcard $(srctree)/$(src)/$(f)),,$(f)))
generic-y += $(foreach f, $(mandatory-y), $(if $(wildcard $(src)/$(f)),,$(f)))
generic-y := $(addprefix $(obj)/, $(generic-y))
generated-y := $(addprefix $(obj)/, $(generated-y))

View File

@ -3,7 +3,7 @@
# Building
# ==========================================================================
src := $(obj)
src := $(if $(VPATH),$(VPATH)/)$(obj)
PHONY := __build
__build:

View File

@ -3,7 +3,7 @@
# Cleaning up
# ==========================================================================
src := $(obj)
src := $(if $(VPATH),$(VPATH)/)$(obj)
PHONY := __clean
__clean:

View File

@ -198,13 +198,13 @@ _c_flags += $(if $(patsubst n%,, \
-D__KCSAN_INSTRUMENT_BARRIERS__)
endif
# $(srctree)/$(src) for including checkin headers from generated source files
# $(objtree)/$(obj) for including generated headers from checkin source files
# $(src) for including checkin headers from generated source files
# $(obj) for including generated headers from checkin source files
ifeq ($(KBUILD_EXTMOD),)
ifdef building_out_of_srctree
_c_flags += $(addprefix -I $(srctree)/,$(src)) $(addprefix -I $(objtree)/,$(obj))
_a_flags += $(addprefix -I $(srctree)/,$(src)) $(addprefix -I $(objtree)/,$(obj))
_cpp_flags += $(addprefix -I $(srctree)/,$(src)) $(addprefix -I $(objtree)/,$(obj))
_c_flags += $(addprefix -I, $(src) $(obj))
_a_flags += $(addprefix -I, $(src) $(obj))
_cpp_flags += $(addprefix -I, $(src) $(obj))
endif
endif

View File

@ -81,7 +81,7 @@ else
# set src + obj - they may be used in the modules's Makefile
obj := $(KBUILD_EXTMOD)
src := $(obj)
src := $(if $(VPATH),$(VPATH)/)$(obj)
# Include the module's Makefile to find KBUILD_EXTRA_SYMBOLS
include $(kbuild-file)

View File

@ -16,7 +16,7 @@ libfdt = $(addprefix libfdt/,$(libfdt-objs))
fdtoverlay-objs := $(libfdt) fdtoverlay.o util.o
# Source files need to get at the userspace version of libfdt_env.h to compile
HOST_EXTRACFLAGS += -I $(srctree)/$(src)/libfdt
HOST_EXTRACFLAGS += -I $(src)/libfdt
ifeq ($(shell pkg-config --exists yaml-0.1 2>/dev/null && echo yes),)
ifneq ($(CHECK_DT_BINDING)$(CHECK_DTBS),)
@ -33,8 +33,8 @@ HOSTLDLIBS_dtc := $(shell pkg-config yaml-0.1 --libs)
endif
# Generated files need one more search path to include headers in source tree
HOSTCFLAGS_dtc-lexer.lex.o := -I $(srctree)/$(src)
HOSTCFLAGS_dtc-parser.tab.o := -I $(srctree)/$(src)
HOSTCFLAGS_dtc-lexer.lex.o := -I $(src)
HOSTCFLAGS_dtc-parser.tab.o := -I $(src)
# dependencies on generated files need to be listed explicitly
$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h

Some files were not shown because too many files have changed in this diff Show More