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

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>

+4 -12
+4 -12
Makefile
··· 1782 1782 @echo >&2 '***' 1783 1783 @exit 1 1784 1784 1785 + KBUILD_MODULES := 1786 + 1785 1787 endif # CONFIG_MODULES 1786 1788 1787 1789 # Single targets ··· 1810 1808 $(single-no-ko): descend 1811 1809 @: 1812 1810 1813 - ifeq ($(KBUILD_EXTMOD),) 1814 - # For the single build of in-tree modules, use a temporary file to avoid 1815 - # the situation of modules_install installing an invalid modules.order. 1816 - MODORDER := .modules.tmp 1817 - endif 1818 - 1811 + # Remove MODORDER when done because it is not the real one. 1819 1812 PHONY += single_modpost 1820 1813 single_modpost: $(single-no-ko) modules_prepare 1821 1814 $(Q){ $(foreach m, $(single-ko), echo $(extmod_prefix)$m;) } > $(MODORDER) 1822 1815 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost 1823 - 1824 - KBUILD_MODULES := 1 1816 + $(Q)rm -f $(MODORDER) 1825 1817 1826 1818 export KBUILD_SINGLE_TARGETS := $(addprefix $(extmod_prefix), $(single-no-ko)) 1827 1819 ··· 1823 1827 build-dirs := $(foreach d, $(build-dirs), \ 1824 1828 $(if $(filter $(d)/%, $(KBUILD_SINGLE_TARGETS)), $(d))) 1825 1829 1826 - endif 1827 - 1828 - ifndef CONFIG_MODULES 1829 - KBUILD_MODULES := 1830 1830 endif 1831 1831 1832 1832 # Handle descending into subdirectories listed in $(build-dirs)