Skip to content

Commit

Permalink
kbuild: Do not unnecessarily regenerate modules.builtin
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
michal42 committed Mar 8, 2010
1 parent bae4cec commit a6c3663
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down Expand Up @@ -1089,7 +1086,7 @@ ifdef CONFIG_MODULES

# By default, build modules as well

all: modules
all: modules modules.builtin

# Build modules
#
Expand All @@ -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
Expand Down

0 comments on commit a6c3663

Please sign in to comment.