Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>

+20 -24
+9 -13
Makefile
··· 1122 1122 1123 1123 PHONY += prepare0 1124 1124 1125 - export extmod_prefix = 1126 - export MODORDER := $(extmod_prefix)modules.order 1127 - export MODULES_NSDEPS := $(extmod_prefix)modules.nsdeps 1128 - 1129 1125 ifeq ($(KBUILD_EXTMOD),) 1130 1126 1131 1127 build-dir := . ··· 1872 1876 1873 1877 ifdef CONFIG_MODULES 1874 1878 1875 - $(MODORDER): $(build-dir) 1879 + modules.order: $(build-dir) 1876 1880 @: 1877 1881 1878 1882 # KBUILD_MODPOST_NOFINAL can be set to skip the final link of modules. ··· 1883 1887 endif 1884 1888 1885 1889 PHONY += modules_check 1886 - modules_check: $(MODORDER) 1890 + modules_check: modules.order 1887 1891 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/modules-check.sh $< 1888 1892 1889 1893 else # CONFIG_MODULES ··· 1924 1928 $(single-no-ko): $(build-dir) 1925 1929 @: 1926 1930 1927 - # Remove MODORDER when done because it is not the real one. 1931 + # Remove modules.order when done because it is not the real one. 1928 1932 PHONY += single_modules 1929 1933 single_modules: $(single-no-ko) modules_prepare 1930 - $(Q){ $(foreach m, $(single-ko), echo $(extmod_prefix)$(m:%.ko=%.o);) } > $(MODORDER) 1934 + $(Q){ $(foreach m, $(single-ko), echo $(m:%.ko=%.o);) } > modules.order 1931 1935 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost 1932 1936 ifneq ($(KBUILD_MODPOST_NOFINAL),1) 1933 1937 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modfinal 1934 1938 endif 1935 - $(Q)rm -f $(MODORDER) 1939 + $(Q)rm -f modules.order 1936 1940 1937 1941 single-goals := $(addprefix $(build-dir)/, $(single-no-ko)) 1938 1942 ··· 2009 2013 quiet_cmd_gen_compile_commands = GEN $@ 2010 2014 cmd_gen_compile_commands = $(PYTHON3) $< -a $(AR) -o $@ $(filter-out $<, $(real-prereqs)) 2011 2015 2012 - $(extmod_prefix)compile_commands.json: $(srctree)/scripts/clang-tools/gen_compile_commands.py \ 2016 + compile_commands.json: $(srctree)/scripts/clang-tools/gen_compile_commands.py \ 2013 2017 $(if $(KBUILD_EXTMOD),, vmlinux.a $(KBUILD_VMLINUX_LIBS)) \ 2014 - $(if $(CONFIG_MODULES), $(MODORDER)) FORCE 2018 + $(if $(CONFIG_MODULES), modules.order) FORCE 2015 2019 $(call if_changed,gen_compile_commands) 2016 2020 2017 - targets += $(extmod_prefix)compile_commands.json 2021 + targets += compile_commands.json 2018 2022 2019 2023 PHONY += clang-tidy clang-analyzer 2020 2024 ··· 2022 2026 quiet_cmd_clang_tools = CHECK $< 2023 2027 cmd_clang_tools = $(PYTHON3) $(srctree)/scripts/clang-tools/run-clang-tools.py $@ $< 2024 2028 2025 - clang-tidy clang-analyzer: $(extmod_prefix)compile_commands.json 2029 + clang-tidy clang-analyzer: compile_commands.json 2026 2030 $(call cmd,clang_tools) 2027 2031 else 2028 2032 clang-tidy clang-analyzer:
+4 -4
scripts/Makefile.modfinal
··· 13 13 include $(srctree)/scripts/Makefile.lib 14 14 15 15 # find all modules listed in modules.order 16 - modules := $(call read-file, $(MODORDER)) 16 + modules := $(call read-file, modules.order) 17 17 18 18 __modfinal: $(modules:%.o=%.ko) 19 19 @: ··· 30 30 %.mod.o: %.mod.c FORCE 31 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 34 $(call if_changed_dep,cc_o_c) 35 35 36 36 quiet_cmd_ld_ko_o = LD [M] $@ ··· 57 57 printf '%s\n' 'savedcmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:) 58 58 59 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 61 +$(call if_changed_except,ld_ko_o,$(objtree)/vmlinux) 62 62 ifdef CONFIG_DEBUG_INFO_BTF_MODULES 63 63 +$(if $(newer-prereqs),$(call cmd,btf_ko)) 64 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 68 # Add FORCE to the prerequisites of a target to force it to be always rebuilt. 69 69 # ---------------------------------------------------------------------------
+3 -3
scripts/Makefile.modinst
··· 40 40 41 41 endif 42 42 43 - modules := $(call read-file, $(MODORDER)) 43 + modules := $(call read-file, modules.order) 44 44 45 45 ifeq ($(KBUILD_EXTMOD),) 46 46 dst := $(MODLIB)/kernel ··· 59 59 suffix-$(CONFIG_MODULE_COMPRESS_ZSTD) := .zst 60 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 63 install-$(CONFIG_MODULES) += $(modules) 64 64 65 65 __modinst: $(install-y) ··· 119 119 # Create necessary directories 120 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 123 $(call cmd,install) 124 124 $(call cmd,strip) 125 125 $(call cmd,sign)
+3 -3
scripts/Makefile.modpost
··· 46 46 $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a) \ 47 47 $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \ 48 48 $(if $(KBUILD_MODPOST_WARN),-w) \ 49 - $(if $(KBUILD_NSDEPS),-d $(MODULES_NSDEPS)) \ 49 + $(if $(KBUILD_NSDEPS),-d modules.nsdeps) \ 50 50 $(if $(CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS)$(KBUILD_NSDEPS),-N) \ 51 51 $(if $(findstring 1, $(KBUILD_EXTRA_WARN)),-W) \ 52 52 -o $@ ··· 61 61 # Read out modules.order to pass in modpost. 62 62 # Otherwise, allmodconfig would fail with "Argument list too long". 63 63 ifdef KBUILD_MODULES 64 - modpost-args += -T $(MODORDER) 65 - modpost-deps += $(MODORDER) 64 + modpost-args += -T modules.order 65 + modpost-deps += modules.order 66 66 endif 67 67 68 68 ifeq ($(KBUILD_EXTMOD),)
+1 -1
scripts/nsdeps
··· 51 51 while read line 52 52 do 53 53 generate_deps $line 54 - done < $MODULES_NSDEPS 54 + done < modules.nsdeps