kbuild: generate include/generated/compile.h in top Makefile
authorMasahiro Yamada <masahiroy@kernel.org>
Sun, 28 Aug 2022 02:39:54 +0000 (11:39 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Wed, 28 Sep 2022 19:40:15 +0000 (04:40 +0900)
Now that UTS_VERSION was separated out, this header can be generated
much earlier, and probably the top Makefile is a better place to do it
than init/Makefile.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Makefile
init/Makefile

index 8536404529a55e912486182fdc37d0af945b3887..f9756ff7c75090a5923b0dbb10331d8422683111 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1194,7 +1194,7 @@ PHONY += prepare archprepare
 
 archprepare: outputmakefile archheaders archscripts scripts include/config/kernel.release \
        asm-generic $(version_h) $(autoksyms_h) include/generated/utsrelease.h \
-       include/generated/autoconf.h remove-stale-files
+       include/generated/compile.h include/generated/autoconf.h remove-stale-files
 
 prepare0: archprepare
        $(Q)$(MAKE) $(build)=scripts/mod
@@ -1256,6 +1256,12 @@ $(version_h): FORCE
 include/generated/utsrelease.h: include/config/kernel.release FORCE
        $(call filechk,utsrelease.h)
 
+filechk_compile.h = $(srctree)/scripts/mkcompile_h \
+       "$(UTS_MACHINE)" "$(CONFIG_CC_VERSION_TEXT)" "$(LD)"
+
+include/generated/compile.h: FORCE
+       $(call filechk,compile.h)
+
 PHONY += headerdep
 headerdep:
        $(Q)find $(srctree)/include/ -name '*.h' | xargs --max-args 1 \
index ba90eb817185202b139e69dde2385c4aae47f979..8316c23bead26814a724e311c41d1b9c5431c86c 100644 (file)
@@ -45,15 +45,9 @@ $(obj)/utsversion-tmp.h: FORCE
 
 clean-files += utsversion-tmp.h
 
-$(obj)/version.o: include/generated/compile.h $(obj)/utsversion-tmp.h
+$(obj)/version.o: $(obj)/utsversion-tmp.h
 CFLAGS_version.o := -include $(obj)/utsversion-tmp.h
 
-filechk_compile.h = $(srctree)/scripts/mkcompile_h \
-       "$(UTS_MACHINE)" "$(CONFIG_CC_VERSION_TEXT)" "$(LD)"
-
-include/generated/compile.h: FORCE
-       $(call filechk,compile.h)
-
 #
 # Build version-timestamp.c with final UTS_VERSION
 #