diff options
Diffstat (limited to 'scripts/Makefile.modpost')
| -rw-r--r-- | scripts/Makefile.modpost | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index 9a3ec20b0be..0e056cffffd 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 | 35 | PHONY := _modpost |
| 36 | _modpost: __modpost | 36 | _modpost: __modpost |
| 37 | 37 | ||
| 38 | include .config | 38 | include .config |
| 39 | include scripts/Kbuild.include | 39 | include scripts/Kbuild.include |
| 40 | include scripts/Makefile.lib | 40 | include scripts/Makefile.lib |
| 41 | 41 | ||
| 42 | symverfile := $(objtree)/Module.symvers | 42 | kernelsymfile := $(objtree)/Module.symvers |
| 43 | modulesymfile := $(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 | 63 | PHONY += __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 | 100 | PHONY += FORCE |
| 98 | 101 | ||
| 99 | FORCE: | 102 | FORCE: |
| 100 | 103 | ||
| @@ -109,3 +112,9 @@ cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd)) | |||
| 109 | ifneq ($(cmd_files),) | 112 | ifneq ($(cmd_files),) |
| 110 | include $(cmd_files) | 113 | include $(cmd_files) |
| 111 | endif | 114 | endif |
| 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) | ||
