diff options
author | Michal Marek <mmarek@suse.cz> | 2010-03-08 04:07:12 -0500 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2010-03-08 05:23:14 -0500 |
commit | a6c366324cacd5f71107dd01362b995a1c67b1ad (patch) | |
tree | 648b4a02fcab7923a28a14d73895ad1c17cd32ab /Makefile | |
parent | bae4cecc09db9d472d71cb262de3c976147ad628 (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>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -882,9 +882,6 @@ $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ; | |||
882 | PHONY += $(vmlinux-dirs) | 882 | PHONY += $(vmlinux-dirs) |
883 | $(vmlinux-dirs): prepare scripts | 883 | $(vmlinux-dirs): prepare scripts |
884 | $(Q)$(MAKE) $(build)=$@ | 884 | $(Q)$(MAKE) $(build)=$@ |
885 | ifdef CONFIG_MODULES | ||
886 | $(Q)$(MAKE) $(modbuiltin)=$@ | ||
887 | endif | ||
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 | ||
1092 | all: modules | 1089 | all: modules modules.builtin |
1093 | 1090 | ||
1094 | # Build modules | 1091 | # Build modules |
1095 | # | 1092 | # |
@@ -1100,11 +1097,16 @@ all: modules | |||
1100 | PHONY += modules | 1097 | PHONY += modules |
1101 | modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) | 1098 | modules: $(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 | ||
1104 | modules.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 |
1110 | PHONY += modules_prepare | 1112 | PHONY += modules_prepare |