Skip to content

Commit f110e5a

Browse files
committed
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 <[email protected]>
1 parent f75a033 commit f110e5a

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

Makefile

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,6 +1782,8 @@ modules modules_install:
17821782
@echo >&2 '***'
17831783
@exit 1
17841784

1785+
KBUILD_MODULES :=
1786+
17851787
endif # CONFIG_MODULES
17861788

17871789
# Single targets
@@ -1808,18 +1810,12 @@ $(single-ko): single_modpost
18081810
$(single-no-ko): descend
18091811
@:
18101812

1811-
ifeq ($(KBUILD_EXTMOD),)
1812-
# For the single build of in-tree modules, use a temporary file to avoid
1813-
# the situation of modules_install installing an invalid modules.order.
1814-
MODORDER := .modules.tmp
1815-
endif
1816-
1813+
# Remove MODORDER when done because it is not the real one.
18171814
PHONY += single_modpost
18181815
single_modpost: $(single-no-ko) modules_prepare
18191816
$(Q){ $(foreach m, $(single-ko), echo $(extmod_prefix)$m;) } > $(MODORDER)
18201817
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
1821-
1822-
KBUILD_MODULES := 1
1818+
$(Q)rm -f $(MODORDER)
18231819

18241820
export KBUILD_SINGLE_TARGETS := $(addprefix $(extmod_prefix), $(single-no-ko))
18251821

@@ -1829,10 +1825,6 @@ build-dirs := $(foreach d, $(build-dirs), \
18291825

18301826
endif
18311827

1832-
ifndef CONFIG_MODULES
1833-
KBUILD_MODULES :=
1834-
endif
1835-
18361828
# Handle descending into subdirectories listed in $(build-dirs)
18371829
# Preset locale variables to speed up the build process. Limit locale
18381830
# tweaks to this spot to avoid wrong language settings when running

0 commit comments

Comments
 (0)