aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2010-03-08 04:07:12 -0500
committerMichal Marek <mmarek@suse.cz>2010-03-08 05:23:14 -0500
commita6c366324cacd5f71107dd01362b995a1c67b1ad (patch)
tree648b4a02fcab7923a28a14d73895ad1c17cd32ab
parentbae4cecc09db9d472d71cb262de3c976147ad628 (diff)
kbuild: Do not unnecessarily regenerate modules.builtin
Only regenerate it if the configuration has changed. Also, do this after the modules build to fix errors with some weird Makefiles that are generated during build. Reported-by: Eric Miao <eric.y.miao@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
-rw-r--r--Makefile12
1 files changed, 7 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 2e74a68878c7..160cadadc471 100644
--- a/Makefile
+++ b/Makefile
@@ -882,9 +882,6 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
882PHONY += $(vmlinux-dirs) 882PHONY += $(vmlinux-dirs)
883$(vmlinux-dirs): prepare scripts 883$(vmlinux-dirs): prepare scripts
884 $(Q)$(MAKE) $(build)=$@ 884 $(Q)$(MAKE) $(build)=$@
885ifdef CONFIG_MODULES
886 $(Q)$(MAKE) $(modbuiltin)=$@
887endif
888 885
889# Build the kernel release string 886# Build the kernel release string
890# 887#
@@ -1089,7 +1086,7 @@ ifdef CONFIG_MODULES
1089 1086
1090# By default, build modules as well 1087# By default, build modules as well
1091 1088
1092all: modules 1089all: modules modules.builtin
1093 1090
1094# Build modules 1091# Build modules
1095# 1092#
@@ -1100,11 +1097,16 @@ all: modules
1100PHONY += modules 1097PHONY += modules
1101modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) 1098modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux)
1102 $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order 1099 $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
1103 $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.builtin) > $(objtree)/modules.builtin
1104 @$(kecho) ' Building modules, stage 2.'; 1100 @$(kecho) ' Building modules, stage 2.';
1105 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost 1101 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
1106 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild 1102 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild
1107 1103
1104modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
1105 $(Q)$(AWK) '!x[$$0]++' $^ > $(objtree)/modules.builtin
1106
1107%/modules.builtin: include/config/auto.conf | modules
1108 $(Q)$(MAKE) $(modbuiltin)=$*
1109
1108 1110
1109# Target to prepare building external modules 1111# Target to prepare building external modules
1110PHONY += modules_prepare 1112PHONY += modules_prepare