History

kbuild: remove extmod_prefix, MODORDER, MODULES_NSDEPS variables

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.

Masahiro Yamada committed 2 years ago

Commit bad6beb1 parent 13b25485 files · +20 −24Browse files

Showing the changes to scripts (4 of 5 files). Show all

Unified · Split

4 files
  1. scripts/Makefile.modfinal +4 −4
  2. scripts/Makefile.modinst +3 −3
  3. scripts/Makefile.modpost +3 −3
  4. scripts/nsdeps +1 −1
scripts/Makefile.modfinal+4−4
@@ -13,7 +13,7 @@ include $(srctree)/scripts/Kbuild.include · 12 unmodified lines
1313 include $(srctree)/scripts/Makefile.lib
1414
1515 # find all modules listed in modules.order
16−modules := $(call read-file, $(MODORDER))
16+modules := $(call read-file, modules.order)
1717
1818 __modfinal: $(modules:%.o=%.ko)
1919 @:
@@ -30,7 +30,7 @@ quiet_cmd_cc_o_c = CC [M] $@ · 10 unmodified lines
3030 %.mod.o: %.mod.c FORCE
3131 $(call if_changed_dep,cc_o_c)
3232
33−$(extmod_prefix).module-common.o: $(srctree)/scripts/module-common.c FORCE
33+.module-common.o: $(srctree)/scripts/module-common.c FORCE
3434 $(call if_changed_dep,cc_o_c)
3535
3636 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
5757 printf '%s\n' 'savedcmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:)
5858
5959 # 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
6161 +$(call if_changed_except,ld_ko_o,$(objtree)/vmlinux)
6262 ifdef CONFIG_DEBUG_INFO_BTF_MODULES
6363 +$(if $(newer-prereqs),$(call cmd,btf_ko))
6464 endif
6565
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
6767
6868 # Add FORCE to the prerequisites of a target to force it to be always rebuilt.
6969 # ---------------------------------------------------------------------------
scripts/Makefile.modinst+3−3
@@ -40,7 +40,7 @@ $(addprefix $(MODLIB)/, modules.builtin modules.builtin.modinfo modules.builtin. · 39 unmodified lines
4040
4141 endif
4242
43−modules := $(call read-file, $(MODORDER))
43+modules := $(call read-file, modules.order)
4444
4545 ifeq ($(KBUILD_EXTMOD),)
4646 dst := $(MODLIB)/kernel
@@ -59,7 +59,7 @@ suffix-$(CONFIG_MODULE_COMPRESS_XZ) := .xz · 12 unmodified lines
5959 suffix-$(CONFIG_MODULE_COMPRESS_ZSTD) := .zst
6060 endif
6161
62−modules := $(patsubst $(extmod_prefix)%.o, $(dst)/%.ko$(suffix-y), $(modules))
62+modules := $(patsubst %.o, $(dst)/%.ko$(suffix-y), $(modules))
6363 install-$(CONFIG_MODULES) += $(modules)
6464
6565 __modinst: $(install-y)
@@ -119,7 +119,7 @@ endif · 53 unmodified lines
119119 # Create necessary directories
120120 $(foreach dir, $(sort $(dir $(install-y))), $(shell mkdir -p $(dir)))
121121
122−$(dst)/%.ko: $(extmod_prefix)%.ko FORCE
122+$(dst)/%.ko: %.ko FORCE
123123 $(call cmd,install)
124124 $(call cmd,strip)
125125 $(call cmd,sign)
scripts/Makefile.modpost+3−3
@@ -46,7 +46,7 @@ modpost-args = \ · 45 unmodified lines
4646 $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a) \
4747 $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \
4848 $(if $(KBUILD_MODPOST_WARN),-w) \
49− $(if $(KBUILD_NSDEPS),-d $(MODULES_NSDEPS)) \
49+ $(if $(KBUILD_NSDEPS),-d modules.nsdeps) \
5050 $(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N) \
5151 $(if $(findstring 1, $(KBUILD_EXTRA_WARN)),-W) \
5252 -o $@
@@ -61,8 +61,8 @@ endif · 8 unmodified lines
6161 # Read out modules.order to pass in modpost.
6262 # Otherwise, allmodconfig would fail with "Argument list too long".
6363 ifdef KBUILD_MODULES
64−modpost-args += -T $(MODORDER)
65−modpost-deps += $(MODORDER)
64+modpost-args += -T modules.order
65+modpost-deps += modules.order
6666 endif
6767
6868 ifeq ($(KBUILD_EXTMOD),)
scripts/nsdeps+1−1
@@ -51,4 +51,4 @@ generate_deps() { · 50 unmodified lines
5151 while read line
5252 do
5353 generate_deps $line
54−done < $MODULES_NSDEPS
54+done < modules.nsdeps