Commit 059bc9fc authored by Masahiro Yamada's avatar Masahiro Yamada

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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 60df1aee
...@@ -1060,7 +1060,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ; ...@@ -1060,7 +1060,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
# Error messages still appears in the original language # Error messages still appears in the original language
PHONY += $(vmlinux-dirs) PHONY += $(vmlinux-dirs)
$(vmlinux-dirs): prepare scripts $(vmlinux-dirs): prepare
$(Q)$(MAKE) $(build)=$@ need-builtin=1 $(Q)$(MAKE) $(build)=$@ need-builtin=1
define filechk_kernel.release define filechk_kernel.release
...@@ -1110,7 +1110,7 @@ prepare1: prepare2 $(version_h) $(autoksyms_h) include/generated/utsrelease.h ...@@ -1110,7 +1110,7 @@ prepare1: prepare2 $(version_h) $(autoksyms_h) include/generated/utsrelease.h
macroprepare: prepare1 archmacros macroprepare: prepare1 archmacros
archprepare: archheaders archscripts macroprepare scripts_basic gcc-plugins archprepare: archheaders archscripts macroprepare scripts gcc-plugins
prepare0: archprepare prepare0: archprepare
$(Q)$(MAKE) $(build)=scripts/mod $(Q)$(MAKE) $(build)=scripts/mod
...@@ -1284,7 +1284,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin) ...@@ -1284,7 +1284,7 @@ modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
# Target to prepare building external modules # Target to prepare building external modules
PHONY += modules_prepare PHONY += modules_prepare
modules_prepare: prepare scripts modules_prepare: prepare
# Target to install modules # Target to install modules
PHONY += modules_install PHONY += modules_install
...@@ -1602,11 +1602,9 @@ help: ...@@ -1602,11 +1602,9 @@ help:
@echo ' clean - remove generated files in module directory only' @echo ' clean - remove generated files in module directory only'
@echo '' @echo ''
# Dummies... PHONY += prepare
PHONY += prepare scripts
prepare: prepare:
$(cmd_crmodverdir) $(cmd_crmodverdir)
scripts: ;
endif # KBUILD_EXTMOD endif # KBUILD_EXTMOD
clean: $(clean-dirs) clean: $(clean-dirs)
...@@ -1710,33 +1708,33 @@ else ...@@ -1710,33 +1708,33 @@ else
target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@)) target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@))
endif endif
%.s: %.c prepare scripts FORCE %.s: %.c prepare FORCE
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.i: %.c prepare scripts FORCE %.i: %.c prepare FORCE
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.o: %.c prepare scripts FORCE %.o: %.c prepare FORCE
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.lst: %.c prepare scripts FORCE %.lst: %.c prepare FORCE
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.s: %.S prepare scripts FORCE %.s: %.S prepare FORCE
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.o: %.S prepare scripts FORCE %.o: %.S prepare FORCE
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.symtypes: %.c prepare scripts FORCE %.symtypes: %.c prepare FORCE
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
%.ll: %.c prepare scripts FORCE %.ll: %.c prepare FORCE
$(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
# Modules # Modules
/: prepare scripts FORCE /: prepare FORCE
$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
$(build)=$(build-dir) $(build)=$(build-dir)
# Make sure the latest headers are built for Documentation # Make sure the latest headers are built for Documentation
Documentation/ samples/: headers_install Documentation/ samples/: headers_install
%/: prepare scripts FORCE %/: prepare FORCE
$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
$(build)=$(build-dir) $(build)=$(build-dir)
%.ko: prepare scripts FORCE %.ko: prepare FORCE
$(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
$(build)=$(build-dir) $(@:.ko=.o) $(build)=$(build-dir) $(@:.ko=.o)
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment