aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.modpost
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Makefile.modpost')
-rw-r--r--scripts/Makefile.modpost19
1 files changed, 14 insertions, 5 deletions
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 9a3ec20b0be2..0e056cffffdb 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -32,14 +32,15 @@
32# Step 4 is solely used to allow module versioning in external modules, 32# Step 4 is solely used to allow module versioning in external modules,
33# where the CRC of each module is retrieved from the Module.symers file. 33# where the CRC of each module is retrieved from the Module.symers file.
34 34
35.PHONY: _modpost 35PHONY := _modpost
36_modpost: __modpost 36_modpost: __modpost
37 37
38include .config 38include .config
39include scripts/Kbuild.include 39include scripts/Kbuild.include
40include scripts/Makefile.lib 40include scripts/Makefile.lib
41 41
42symverfile := $(objtree)/Module.symvers 42kernelsymfile := $(objtree)/Module.symvers
43modulesymfile := $(KBUILD_EXTMOD)/Modules.symvers
43 44
44# Step 1), find all modules listed in $(MODVERDIR)/ 45# Step 1), find all modules listed in $(MODVERDIR)/
45__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod))) 46__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
@@ -54,10 +55,12 @@ quiet_cmd_modpost = MODPOST
54 cmd_modpost = scripts/mod/modpost \ 55 cmd_modpost = scripts/mod/modpost \
55 $(if $(CONFIG_MODVERSIONS),-m) \ 56 $(if $(CONFIG_MODVERSIONS),-m) \
56 $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,) \ 57 $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,) \
57 $(if $(KBUILD_EXTMOD),-i,-o) $(symverfile) \ 58 $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \
59 $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \
60 $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
58 $(filter-out FORCE,$^) 61 $(filter-out FORCE,$^)
59 62
60.PHONY: __modpost 63PHONY += __modpost
61__modpost: $(wildcard vmlinux) $(modules:.ko=.o) FORCE 64__modpost: $(wildcard vmlinux) $(modules:.ko=.o) FORCE
62 $(call cmd,modpost) 65 $(call cmd,modpost)
63 66
@@ -94,7 +97,7 @@ targets += $(modules)
94# Add FORCE to the prequisites of a target to force it to be always rebuilt. 97# Add FORCE to the prequisites of a target to force it to be always rebuilt.
95# --------------------------------------------------------------------------- 98# ---------------------------------------------------------------------------
96 99
97.PHONY: FORCE 100PHONY += FORCE
98 101
99FORCE: 102FORCE:
100 103
@@ -109,3 +112,9 @@ cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
109ifneq ($(cmd_files),) 112ifneq ($(cmd_files),)
110 include $(cmd_files) 113 include $(cmd_files)
111endif 114endif
115
116
117# Declare the contents of the .PHONY variable as phony. We keep that
118# information in a variable se we can use it in if_changed and friends.
119
120.PHONY: $(PHONY)