Commit f110e5a2 authored by Masahiro Yamada's avatar Masahiro Yamada

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: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent f75a0334
...@@ -1782,6 +1782,8 @@ modules modules_install: ...@@ -1782,6 +1782,8 @@ modules modules_install:
@echo >&2 '***' @echo >&2 '***'
@exit 1 @exit 1
KBUILD_MODULES :=
endif # CONFIG_MODULES endif # CONFIG_MODULES
# Single targets # Single targets
...@@ -1808,18 +1810,12 @@ $(single-ko): single_modpost ...@@ -1808,18 +1810,12 @@ $(single-ko): single_modpost
$(single-no-ko): descend $(single-no-ko): descend
@: @:
ifeq ($(KBUILD_EXTMOD),) # Remove MODORDER when done because it is not the real one.
# 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
PHONY += single_modpost PHONY += single_modpost
single_modpost: $(single-no-ko) modules_prepare single_modpost: $(single-no-ko) modules_prepare
$(Q){ $(foreach m, $(single-ko), echo $(extmod_prefix)$m;) } > $(MODORDER) $(Q){ $(foreach m, $(single-ko), echo $(extmod_prefix)$m;) } > $(MODORDER)
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
$(Q)rm -f $(MODORDER)
KBUILD_MODULES := 1
export KBUILD_SINGLE_TARGETS := $(addprefix $(extmod_prefix), $(single-no-ko)) export KBUILD_SINGLE_TARGETS := $(addprefix $(extmod_prefix), $(single-no-ko))
...@@ -1829,10 +1825,6 @@ build-dirs := $(foreach d, $(build-dirs), \ ...@@ -1829,10 +1825,6 @@ build-dirs := $(foreach d, $(build-dirs), \
endif endif
ifndef CONFIG_MODULES
KBUILD_MODULES :=
endif
# Handle descending into subdirectories listed in $(build-dirs) # Handle descending into subdirectories listed in $(build-dirs)
# Preset locale variables to speed up the build process. Limit locale # Preset locale variables to speed up the build process. Limit locale
# tweaks to this spot to avoid wrong language settings when running # tweaks to this spot to avoid wrong language settings when running
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment