summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2022-08-28 05:39:50 +0300
committerMasahiro Yamada <masahiroy@kernel.org>2022-09-28 22:40:15 +0300
commitf110e5a250e3c5db417e094b3dd86f1c135291ca (patch)
tree7c1a601fc622a83bcfbc0606d2baf4379affb53d /Makefile
parentf75a03340c2c2eea772e4d59412135021afea493 (diff)
downloadlinux-f110e5a250e3c5db417e094b3dd86f1c135291ca.tar.xz
kbuild: refactor single builds of *.ko
Remove the potentially invalid modules.order instead of using the temporary file. Also, KBUILD_MODULES is don't care for single builds. No need to cancel it. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 4 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index e0b363398939..009d03f3c80a 100644
--- a/Makefile
+++ b/Makefile
@@ -1782,6 +1782,8 @@ modules modules_install:
@echo >&2 '***'
@exit 1
+KBUILD_MODULES :=
+
endif # CONFIG_MODULES
# Single targets
@@ -1808,18 +1810,12 @@ $(single-ko): single_modpost
$(single-no-ko): descend
@:
-ifeq ($(KBUILD_EXTMOD),)
-# For the single build of in-tree modules, use a temporary file to avoid
-# the situation of modules_install installing an invalid modules.order.
-MODORDER := .modules.tmp
-endif
-
+# Remove MODORDER when done because it is not the real one.
PHONY += single_modpost
single_modpost: $(single-no-ko) modules_prepare
$(Q){ $(foreach m, $(single-ko), echo $(extmod_prefix)$m;) } > $(MODORDER)
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
-
-KBUILD_MODULES := 1
+ $(Q)rm -f $(MODORDER)
export KBUILD_SINGLE_TARGETS := $(addprefix $(extmod_prefix), $(single-no-ko))
@@ -1829,10 +1825,6 @@ build-dirs := $(foreach d, $(build-dirs), \
endif
-ifndef CONFIG_MODULES
-KBUILD_MODULES :=
-endif
-
# Handle descending into subdirectories listed in $(build-dirs)
# Preset locale variables to speed up the build process. Limit locale
# tweaks to this spot to avoid wrong language settings when running