With the previous changes, $(extmod_prefix), $(MODORDER), and $(MODULES_NSDEPS) are constant. (empty, modules.order, and modules.nsdeps, respectively). Remove these variables and hard-code their values.
Showing the changes to scripts (4 of 5 files). Show all
Unified · Split
| @@ -13,7 +13,7 @@ include $(srctree)/scripts/Kbuild.include · 12 unmodified lines | |||
| 13 | include $(srctree)/scripts/Makefile.lib | 13 | include $(srctree)/scripts/Makefile.lib |
| 14 | 14 | ||
| 15 | # find all modules listed in modules.order | 15 | # find all modules listed in modules.order |
| 16 | modules := $(call read-file, $(MODORDER)) | 16 | modules := $(call read-file, modules.order) |
| 17 | 17 | ||
| 18 | __modfinal: $(modules:%.o=%.ko) | 18 | __modfinal: $(modules:%.o=%.ko) |
| 19 | @: | 19 | @: |
| @@ -30,7 +30,7 @@ quiet_cmd_cc_o_c = CC [M] $@ · 10 unmodified lines | |||
| 30 | %.mod.o: %.mod.c FORCE | 30 | %.mod.o: %.mod.c FORCE |
| 31 | $(call if_changed_dep,cc_o_c) | 31 | $(call if_changed_dep,cc_o_c) |
| 32 | 32 | ||
| 33 | $(extmod_prefix).module-common.o: $(srctree)/scripts/module-common.c FORCE | 33 | .module-common.o: $(srctree)/scripts/module-common.c FORCE |
| 34 | $(call if_changed_dep,cc_o_c) | 34 | $(call if_changed_dep,cc_o_c) |
| 35 | 35 | ||
| 36 | quiet_cmd_ld_ko_o = LD [M] $@ | 36 | quiet_cmd_ld_ko_o = LD [M] $@ |
| @@ -57,13 +57,13 @@ if_changed_except = $(if $(call newer_prereqs_except,$(2))$(cmd-check), \ · 20 unmodified lines | |||
| 57 | printf '%s\n' 'savedcmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:) | 57 | printf '%s\n' 'savedcmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:) |
| 58 | 58 | ||
| 59 | # Re-generate module BTFs if either module's .ko or vmlinux changed | 59 | # Re-generate module BTFs if either module's .ko or vmlinux changed |
| 60 | %.ko: %.o %.mod.o $(extmod_prefix).module-common.o $(objtree)/scripts/module.lds $(and $(CONFIG_DEBUG_INFO_BTF_MODULES),$(KBUILD_BUILTIN),$(objtree)/vmlinux) FORCE | 60 | %.ko: %.o %.mod.o .module-common.o $(objtree)/scripts/module.lds $(and $(CONFIG_DEBUG_INFO_BTF_MODULES),$(KBUILD_BUILTIN),$(objtree)/vmlinux) FORCE |
| 61 | +$(call if_changed_except,ld_ko_o,$(objtree)/vmlinux) | 61 | +$(call if_changed_except,ld_ko_o,$(objtree)/vmlinux) |
| 62 | ifdef CONFIG_DEBUG_INFO_BTF_MODULES | 62 | ifdef CONFIG_DEBUG_INFO_BTF_MODULES |
| 63 | +$(if $(newer-prereqs),$(call cmd,btf_ko)) | 63 | +$(if $(newer-prereqs),$(call cmd,btf_ko)) |
| 64 | endif | 64 | endif |
| 65 | 65 | ||
| 66 | targets += $(modules:%.o=%.ko) $(modules:%.o=%.mod.o) $(extmod_prefix).module-common.o | 66 | targets += $(modules:%.o=%.ko) $(modules:%.o=%.mod.o) .module-common.o |
| 67 | 67 | ||
| 68 | # Add FORCE to the prerequisites of a target to force it to be always rebuilt. | 68 | # Add FORCE to the prerequisites of a target to force it to be always rebuilt. |
| 69 | # --------------------------------------------------------------------------- | 69 | # --------------------------------------------------------------------------- |
| @@ -40,7 +40,7 @@ $(addprefix $(MODLIB)/, modules.builtin modules.builtin.modinfo modules.builtin. · 39 unmodified lines | |||
| 40 | 40 | ||
| 41 | endif | 41 | endif |
| 42 | 42 | ||
| 43 | modules := $(call read-file, $(MODORDER)) | 43 | modules := $(call read-file, modules.order) |
| 44 | 44 | ||
| 45 | ifeq ($(KBUILD_EXTMOD),) | 45 | ifeq ($(KBUILD_EXTMOD),) |
| 46 | dst := $(MODLIB)/kernel | 46 | dst := $(MODLIB)/kernel |
| @@ -59,7 +59,7 @@ suffix-$(CONFIG_MODULE_COMPRESS_XZ) := .xz · 12 unmodified lines | |||
| 59 | suffix-$(CONFIG_MODULE_COMPRESS_ZSTD) := .zst | 59 | suffix-$(CONFIG_MODULE_COMPRESS_ZSTD) := .zst |
| 60 | endif | 60 | endif |
| 61 | 61 | ||
| 62 | modules := $(patsubst $(extmod_prefix)%.o, $(dst)/%.ko$(suffix-y), $(modules)) | 62 | modules := $(patsubst %.o, $(dst)/%.ko$(suffix-y), $(modules)) |
| 63 | install-$(CONFIG_MODULES) += $(modules) | 63 | install-$(CONFIG_MODULES) += $(modules) |
| 64 | 64 | ||
| 65 | __modinst: $(install-y) | 65 | __modinst: $(install-y) |
| @@ -119,7 +119,7 @@ endif · 53 unmodified lines | |||
| 119 | # Create necessary directories | 119 | # Create necessary directories |
| 120 | $(foreach dir, $(sort $(dir $(install-y))), $(shell mkdir -p $(dir))) | 120 | $(foreach dir, $(sort $(dir $(install-y))), $(shell mkdir -p $(dir))) |
| 121 | 121 | ||
| 122 | $(dst)/%.ko: $(extmod_prefix)%.ko FORCE | 122 | $(dst)/%.ko: %.ko FORCE |
| 123 | $(call cmd,install) | 123 | $(call cmd,install) |
| 124 | $(call cmd,strip) | 124 | $(call cmd,strip) |
| 125 | $(call cmd,sign) | 125 | $(call cmd,sign) |
| @@ -46,7 +46,7 @@ modpost-args = \ · 45 unmodified lines | |||
| 46 | $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a) \ | 46 | $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a) \ |
| 47 | $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \ | 47 | $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \ |
| 48 | $(if $(KBUILD_MODPOST_WARN),-w) \ | 48 | $(if $(KBUILD_MODPOST_WARN),-w) \ |
| 49 | $(if $(KBUILD_NSDEPS),-d $(MODULES_NSDEPS)) \ | 49 | $(if $(KBUILD_NSDEPS),-d modules.nsdeps) \ |
| 50 | $(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N) \ | 50 | $(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N) \ |
| 51 | $(if $(findstring 1, $(KBUILD_EXTRA_WARN)),-W) \ | 51 | $(if $(findstring 1, $(KBUILD_EXTRA_WARN)),-W) \ |
| 52 | -o $@ | 52 | -o $@ |
| @@ -61,8 +61,8 @@ endif · 8 unmodified lines | |||
| 61 | # Read out modules.order to pass in modpost. | 61 | # Read out modules.order to pass in modpost. |
| 62 | # Otherwise, allmodconfig would fail with "Argument list too long". | 62 | # Otherwise, allmodconfig would fail with "Argument list too long". |
| 63 | ifdef KBUILD_MODULES | 63 | ifdef KBUILD_MODULES |
| 64 | modpost-args += -T $(MODORDER) | 64 | modpost-args += -T modules.order |
| 65 | modpost-deps += $(MODORDER) | 65 | modpost-deps += modules.order |
| 66 | endif | 66 | endif |
| 67 | 67 | ||
| 68 | ifeq ($(KBUILD_EXTMOD),) | 68 | ifeq ($(KBUILD_EXTMOD),) |
| @@ -51,4 +51,4 @@ generate_deps() { · 50 unmodified lines | |||
| 51 | while read line | 51 | while read line |
| 52 | do | 52 | do |
| 53 | generate_deps $line | 53 | generate_deps $line |
| 54 | done < $MODULES_NSDEPS | 54 | done < modules.nsdeps |