aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rw-r--r--scripts/Makefile2
-rw-r--r--scripts/Makefile.modpost12
3 files changed, 11 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index b06b1ea46fe5..22451c2ac1e0 100644
--- a/Makefile
+++ b/Makefile
@@ -736,6 +736,7 @@ endif # ifdef CONFIG_KALLSYMS
736# vmlinux image - including updated kernel symbols 736# vmlinux image - including updated kernel symbols
737vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE 737vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE
738 $(call if_changed_rule,vmlinux__) 738 $(call if_changed_rule,vmlinux__)
739 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $@
739 $(Q)rm -f .old_version 740 $(Q)rm -f .old_version
740 741
741# The actual objects are generated when descending, 742# The actual objects are generated when descending,
diff --git a/scripts/Makefile b/scripts/Makefile
index d531a1fcef0c..ea41de8fb7f5 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -19,7 +19,7 @@ always := $(hostprogs-y)
19hostprogs-y += unifdef 19hostprogs-y += unifdef
20 20
21subdir-$(CONFIG_MODVERSIONS) += genksyms 21subdir-$(CONFIG_MODVERSIONS) += genksyms
22subdir-$(CONFIG_MODULES) += mod 22subdir-y += mod
23 23
24# Let clean descend into subdirs 24# Let clean descend into subdirs
25subdir- += basic kconfig package 25subdir- += basic kconfig package
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 0a64688c2b5d..9137df2f9290 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -51,19 +51,25 @@ _modpost: $(modules)
51 51
52# Step 2), invoke modpost 52# Step 2), invoke modpost
53# Includes step 3,4 53# Includes step 3,4
54quiet_cmd_modpost = MODPOST 54quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules
55 cmd_modpost = scripts/mod/modpost \ 55 cmd_modpost = scripts/mod/modpost \
56 $(if $(CONFIG_MODVERSIONS),-m) \ 56 $(if $(CONFIG_MODVERSIONS),-m) \
57 $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,) \ 57 $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,) \
58 $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \ 58 $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \
59 $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \ 59 $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \
60 $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \ 60 $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
61 $(filter-out FORCE,$^) 61 $(wildcard vmlinux) $(filter-out FORCE,$^)
62 62
63PHONY += __modpost 63PHONY += __modpost
64__modpost: $(wildcard vmlinux) $(modules:.ko=.o) FORCE 64__modpost: $(modules:.ko=.o) FORCE
65 $(call cmd,modpost) 65 $(call cmd,modpost)
66 66
67quiet_cmd_kernel-mod = MODPOST $@
68 cmd_kernel-mod = $(cmd_modpost)
69
70vmlinux: FORCE
71 $(call cmd,kernel-mod)
72
67# Declare generated files as targets for modpost 73# Declare generated files as targets for modpost
68$(symverfile): __modpost ; 74$(symverfile): __modpost ;
69$(modules:.ko=.mod.c): __modpost ; 75$(modules:.ko=.mod.c): __modpost ;