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
13include $(srctree)/scripts/Makefile.lib13include $(srctree)/scripts/Makefile.lib
14 14
15# find all modules listed in modules.order15# find all modules listed in modules.order
16modules := $(call read-file, $(MODORDER))16modules := $(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 FORCE30%.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 FORCE33.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
36quiet_cmd_ld_ko_o = LD [M] $@36quiet_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 changed59# 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) FORCE60%.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)
62ifdef CONFIG_DEBUG_INFO_BTF_MODULES62ifdef CONFIG_DEBUG_INFO_BTF_MODULES
63 +$(if $(newer-prereqs),$(call cmd,btf_ko))63 +$(if $(newer-prereqs),$(call cmd,btf_ko))
64endif64endif
65 65
66targets += $(modules:%.o=%.ko) $(modules:%.o=%.mod.o) $(extmod_prefix).module-common.o66targets += $(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# ---------------------------------------------------------------------------
scripts/Makefile.modinst+3−3
@@ -40,7 +40,7 @@ $(addprefix $(MODLIB)/, modules.builtin modules.builtin.modinfo modules.builtin. · 39 unmodified lines
40 40
41endif41endif
42 42
43modules := $(call read-file, $(MODORDER))43modules := $(call read-file, modules.order)
44 44
45ifeq ($(KBUILD_EXTMOD),)45ifeq ($(KBUILD_EXTMOD),)
46dst := $(MODLIB)/kernel46dst := $(MODLIB)/kernel
@@ -59,7 +59,7 @@ suffix-$(CONFIG_MODULE_COMPRESS_XZ) := .xz · 12 unmodified lines
59suffix-$(CONFIG_MODULE_COMPRESS_ZSTD) := .zst59suffix-$(CONFIG_MODULE_COMPRESS_ZSTD) := .zst
60endif60endif
61 61
62modules := $(patsubst $(extmod_prefix)%.o, $(dst)/%.ko$(suffix-y), $(modules))62modules := $(patsubst %.o, $(dst)/%.ko$(suffix-y), $(modules))
63install-$(CONFIG_MODULES) += $(modules)63install-$(CONFIG_MODULES) += $(modules)
64 64
65__modinst: $(install-y)65__modinst: $(install-y)
@@ -119,7 +119,7 @@ endif · 53 unmodified lines
119# Create necessary directories119# 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 FORCE122$(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)
scripts/Makefile.modpost+3−3
@@ -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".
63ifdef KBUILD_MODULES63ifdef KBUILD_MODULES
64modpost-args += -T $(MODORDER)64modpost-args += -T modules.order
65modpost-deps += $(MODORDER)65modpost-deps += modules.order
66endif66endif
67 67
68ifeq ($(KBUILD_EXTMOD),)68ifeq ($(KBUILD_EXTMOD),)
scripts/nsdeps+1−1
@@ -51,4 +51,4 @@ generate_deps() { · 50 unmodified lines
51while read line51while read line
52do52do
53 generate_deps $line53 generate_deps $line
54done < $MODULES_NSDEPS54done < modules.nsdeps