History

kbuild: prefix $(srctree)/ to some included Makefiles

VPATH is used in Kbuild to make pattern rules search for prerequisites in both $(objtree) and $(srctree). Some of *.c, *.S files are not 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.

Masahiro Yamada committed 5 years ago

Commit 3204a7f1 parent 1e28eed9 files · +17 −17Browse files

Showing the changes to scripts (8 of 9 files). Show all

Unified · Split

8 files
  1. scripts/Makefile.asm-generic +2 −2
  2. scripts/Makefile.build +4 −4
  3. scripts/Makefile.clean +1 −1
  4. scripts/Makefile.dtbinst +1 −1
  5. scripts/Makefile.headersinst +1 −1
  6. scripts/Makefile.modinst +1 −1
  7. scripts/Makefile.modpost +2 −2
  8. scripts/Makefile.modsign +1 −1
scripts/Makefile.asm-generic+2−2
@@ -14,10 +14,10 @@ src := $(subst /generated,,$(obj)) · 13 unmodified lines
1414
1515 # $(generic)/Kbuild lists mandatory-y. Exclude um since it is a special case.
1616 ifneq ($(SRCARCH),um)
17−include $(generic)/Kbuild
17+include $(srctree)/$(generic)/Kbuild
1818 endif
1919
20−include scripts/Kbuild.include
20+include $(srctree)/scripts/Kbuild.include
2121
2222 redundant := $(filter $(mandatory-y) $(generated-y), $(generic-y))
2323 redundant += $(foreach f, $(generic-y), $(if $(wildcard $(srctree)/$(src)/$(f)),$(f)))
scripts/Makefile.build+4−4
@@ -35,27 +35,27 @@ subdir-ccflags-y := · 34 unmodified lines
3535 # Read auto.conf if it exists, otherwise ignore
3636 -include include/config/auto.conf
3737
38−include scripts/Kbuild.include
38+include $(srctree)/scripts/Kbuild.include
3939
4040 # The filename Kbuild has precedence over Makefile
4141 kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
4242 kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile)
4343 include $(kbuild-file)
4444
45−include scripts/Makefile.lib
45+include $(srctree)/scripts/Makefile.lib
4646
4747 # Do not include hostprogs rules unless needed.
4848 # $(sort ...) is used here to remove duplicated words and excessive spaces.
4949 hostprogs := $(sort $(hostprogs))
5050 ifneq ($(hostprogs),)
51−include scripts/Makefile.host
51+include $(srctree)/scripts/Makefile.host
5252 endif
5353
5454 # Do not include userprogs rules unless needed.
5555 # $(sort ...) is used here to remove duplicated words and excessive spaces.
5656 userprogs := $(sort $(userprogs))
5757 ifneq ($(userprogs),)
58−include scripts/Makefile.userprogs
58+include $(srctree)/scripts/Makefile.userprogs
5959 endif
6060
6161 ifndef obj
scripts/Makefile.clean+1−1
@@ -8,7 +8,7 @@ src := $(obj) · 7 unmodified lines
88 PHONY := __clean
99 __clean:
1010
11−include scripts/Kbuild.include
11+include $(srctree)/scripts/Kbuild.include
1212
1313 # The filename Kbuild has precedence over Makefile
1414 kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
scripts/Makefile.dtbinst+1−1
@@ -14,7 +14,7 @@ PHONY := __dtbs_install · 13 unmodified lines
1414 __dtbs_install:
1515
1616 include include/config/auto.conf
17−include scripts/Kbuild.include
17+include $(srctree)/scripts/Kbuild.include
1818 include $(src)/Makefile
1919
2020 dtbs := $(addprefix $(dst)/, $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-)))
scripts/Makefile.headersinst+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212 PHONY := __headers
1313 __headers:
1414
15−include scripts/Kbuild.include
15+include $(srctree)/scripts/Kbuild.include
1616
1717 src := $(srctree)/$(obj)
1818 gen := $(objtree)/$(subst include/,include/generated/,$(obj))
scripts/Makefile.modinst+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 PHONY := __modinst
77 __modinst:
88
9−include scripts/Kbuild.include
9+include $(srctree)/scripts/Kbuild.include
1010
1111 modules := $(sort $(shell cat $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)modules.order))
1212
scripts/Makefile.modpost+2−2
@@ -41,10 +41,10 @@ PHONY := __modpost · 40 unmodified lines
4141 __modpost:
4242
4343 include include/config/auto.conf
44−include scripts/Kbuild.include
44+include $(srctree)/scripts/Kbuild.include
4545
4646 # for ld_flags
47−include scripts/Makefile.lib
47+include $(srctree)/scripts/Makefile.lib
4848
4949 MODPOST = scripts/mod/modpost \
5050 $(if $(CONFIG_MODVERSIONS),-m) \
scripts/Makefile.modsign+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 PHONY := __modsign
77 __modsign:
88
9−include scripts/Kbuild.include
9+include $(srctree)/scripts/Kbuild.include
1010
1111 modules := $(sort $(shell cat modules.order))
1212