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 ...
Showing
- Documentation/Makefile 4 additions, 4 deletionsDocumentation/Makefile
- Documentation/devicetree/bindings/Makefile 3 additions, 3 deletionsDocumentation/devicetree/bindings/Makefile
- Documentation/kbuild/makefiles.rst 6 additions, 6 deletionsDocumentation/kbuild/makefiles.rst
- Makefile 7 additions, 0 deletionsMakefile
- arch/arc/boot/dts/Makefile 1 addition, 2 deletionsarch/arc/boot/dts/Makefile
- arch/arm/Kbuild 1 addition, 1 deletionarch/arm/Kbuild
- arch/arm/boot/Makefile 1 addition, 2 deletionsarch/arm/boot/Makefile
- arch/arm/mach-s3c/Makefile 1 addition, 1 deletionarch/arm/mach-s3c/Makefile
- arch/arm/plat-orion/Makefile 1 addition, 1 deletionarch/arm/plat-orion/Makefile
- arch/arm/tools/Makefile 1 addition, 1 deletionarch/arm/tools/Makefile
- arch/arm64/kernel/vdso/Makefile 1 addition, 1 deletionarch/arm64/kernel/vdso/Makefile
- arch/arm64/kvm/Makefile 2 additions, 2 deletionsarch/arm64/kvm/Makefile
- arch/arm64/kvm/hyp/Makefile 1 addition, 1 deletionarch/arm64/kvm/hyp/Makefile
- arch/csky/boot/dts/Makefile 1 addition, 3 deletionsarch/csky/boot/dts/Makefile
- arch/csky/kernel/vdso/Makefile 1 addition, 1 deletionarch/csky/kernel/vdso/Makefile
- arch/loongarch/kvm/Makefile 1 addition, 1 deletionarch/loongarch/kvm/Makefile
- arch/loongarch/vdso/Makefile 1 addition, 1 deletionarch/loongarch/vdso/Makefile
- arch/mips/kernel/syscalls/Makefile 1 addition, 1 deletionarch/mips/kernel/syscalls/Makefile
- arch/mips/vdso/Makefile 2 additions, 2 deletionsarch/mips/vdso/Makefile
- arch/nios2/boot/dts/Makefile 1 addition, 2 deletionsarch/nios2/boot/dts/Makefile
Please register or sign in to comment