diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-11-28 22:56:30 -0500 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2018-12-01 09:09:37 -0500 |
commit | 059bc9fc375e00f159f9d7c5ca9d18ab843f95de (patch) | |
tree | 7a7e3b3c1dae7603c4613d0a78c8c545761f9662 /Makefile | |
parent | 60df1aee2aecb53efb4218b4dfdf7d6c80a5a3de (diff) |
kbuild: make 'archprepare' depend on 'scripts'
Before start descending, Kbuild needs to run 'prepare' and 'scripts',
which has been orthogonal to each other.
Going forward, let's consider 'scripts' is a part of the preparation.
This will allow more cleanups.
Move 'scripts' to the prerequisite of 'archprepare', where UML starts
compiling target *.c files.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 32 |
1 files changed, 15 insertions, 17 deletions
@@ -1060,7 +1060,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ; | |||
1060 | # Error messages still appears in the original language | 1060 | # Error messages still appears in the original language |
1061 | 1061 | ||
1062 | PHONY += $(vmlinux-dirs) | 1062 | PHONY += $(vmlinux-dirs) |
1063 | $(vmlinux-dirs): prepare scripts | 1063 | $(vmlinux-dirs): prepare |
1064 | $(Q)$(MAKE) $(build)=$@ need-builtin=1 | 1064 | $(Q)$(MAKE) $(build)=$@ need-builtin=1 |
1065 | 1065 | ||
1066 | define filechk_kernel.release | 1066 | define filechk_kernel.release |
@@ -1110,7 +1110,7 @@ prepare1: prepare2 $(version_h) $(autoksyms_h) include/generated/utsrelease.h | |||
1110 | 1110 | ||
1111 | macroprepare: prepare1 archmacros | 1111 | macroprepare: prepare1 archmacros |
1112 | 1112 | ||
1113 | archprepare: archheaders archscripts macroprepare scripts_basic gcc-plugins | 1113 | archprepare: archheaders archscripts macroprepare scripts gcc-plugins |
1114 | 1114 | ||
1115 | prepare0: archprepare | 1115 | prepare0: archprepare |
1116 | $(Q)$(MAKE) $(build)=scripts/mod | 1116 | $(Q)$(MAKE) $(build)=scripts/mod |
@@ -1284,7 +1284,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin) | |||
1284 | 1284 | ||
1285 | # Target to prepare building external modules | 1285 | # Target to prepare building external modules |
1286 | PHONY += modules_prepare | 1286 | PHONY += modules_prepare |
1287 | modules_prepare: prepare scripts | 1287 | modules_prepare: prepare |
1288 | 1288 | ||
1289 | # Target to install modules | 1289 | # Target to install modules |
1290 | PHONY += modules_install | 1290 | PHONY += modules_install |
@@ -1602,11 +1602,9 @@ help: | |||
1602 | @echo ' clean - remove generated files in module directory only' | 1602 | @echo ' clean - remove generated files in module directory only' |
1603 | @echo '' | 1603 | @echo '' |
1604 | 1604 | ||
1605 | # Dummies... | 1605 | PHONY += prepare |
1606 | PHONY += prepare scripts | ||
1607 | prepare: | 1606 | prepare: |
1608 | $(cmd_crmodverdir) | 1607 | $(cmd_crmodverdir) |
1609 | scripts: ; | ||
1610 | endif # KBUILD_EXTMOD | 1608 | endif # KBUILD_EXTMOD |
1611 | 1609 | ||
1612 | clean: $(clean-dirs) | 1610 | clean: $(clean-dirs) |
@@ -1710,33 +1708,33 @@ else | |||
1710 | target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@)) | 1708 | target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@)) |
1711 | endif | 1709 | endif |
1712 | 1710 | ||
1713 | %.s: %.c prepare scripts FORCE | 1711 | %.s: %.c prepare FORCE |
1714 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) | 1712 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
1715 | %.i: %.c prepare scripts FORCE | 1713 | %.i: %.c prepare FORCE |
1716 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) | 1714 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
1717 | %.o: %.c prepare scripts FORCE | 1715 | %.o: %.c prepare FORCE |
1718 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) | 1716 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
1719 | %.lst: %.c prepare scripts FORCE | 1717 | %.lst: %.c prepare FORCE |
1720 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) | 1718 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
1721 | %.s: %.S prepare scripts FORCE | 1719 | %.s: %.S prepare FORCE |
1722 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) | 1720 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
1723 | %.o: %.S prepare scripts FORCE | 1721 | %.o: %.S prepare FORCE |
1724 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) | 1722 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
1725 | %.symtypes: %.c prepare scripts FORCE | 1723 | %.symtypes: %.c prepare FORCE |
1726 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) | 1724 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
1727 | %.ll: %.c prepare scripts FORCE | 1725 | %.ll: %.c prepare FORCE |
1728 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) | 1726 | $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) |
1729 | 1727 | ||
1730 | # Modules | 1728 | # Modules |
1731 | /: prepare scripts FORCE | 1729 | /: prepare FORCE |
1732 | $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ | 1730 | $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ |
1733 | $(build)=$(build-dir) | 1731 | $(build)=$(build-dir) |
1734 | # Make sure the latest headers are built for Documentation | 1732 | # Make sure the latest headers are built for Documentation |
1735 | Documentation/ samples/: headers_install | 1733 | Documentation/ samples/: headers_install |
1736 | %/: prepare scripts FORCE | 1734 | %/: prepare FORCE |
1737 | $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ | 1735 | $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ |
1738 | $(build)=$(build-dir) | 1736 | $(build)=$(build-dir) |
1739 | %.ko: prepare scripts FORCE | 1737 | %.ko: prepare FORCE |
1740 | $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ | 1738 | $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ |
1741 | $(build)=$(build-dir) $(@:.ko=.o) | 1739 | $(build)=$(build-dir) $(@:.ko=.o) |
1742 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost | 1740 | $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost |