summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2010-03-08 12:07:12 +0300
committerMichal Marek <mmarek@suse.cz>2010-03-08 13:23:14 +0300
commita6c366324cacd5f71107dd01362b995a1c67b1ad (patch)
tree648b4a02fcab7923a28a14d73895ad1c17cd32ab /Makefile
parentbae4cecc09db9d472d71cb262de3c976147ad628 (diff)
downloadlinux-a6c366324cacd5f71107dd01362b995a1c67b1ad.tar.xz
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>
Diffstat (limited to 'Makefile')
-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) ;
PHONY += $(vmlinux-dirs)
$(vmlinux-dirs): prepare scripts
$(Q)$(MAKE) $(build)=$@
-ifdef CONFIG_MODULES
- $(Q)$(MAKE) $(modbuiltin)=$@
-endif
# Build the kernel release string
#
@@ -1089,7 +1086,7 @@ ifdef CONFIG_MODULES
# By default, build modules as well
-all: modules
+all: modules modules.builtin
# Build modules
#
@@ -1100,11 +1097,16 @@ all: modules
PHONY += modules
modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux)
$(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
- $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.builtin) > $(objtree)/modules.builtin
@$(kecho) ' Building modules, stage 2.';
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild
+modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
+ $(Q)$(AWK) '!x[$$0]++' $^ > $(objtree)/modules.builtin
+
+%/modules.builtin: include/config/auto.conf | modules
+ $(Q)$(MAKE) $(modbuiltin)=$*
+
# Target to prepare building external modules
PHONY += modules_prepare