Skip to content
/ linux Public
forked from torvalds/linux

Commit

Permalink
kbuild: generate include/generated/compile.h in top Makefile
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
masahir0y committed Sep 28, 2022
1 parent 2df8220 commit a55f283
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand Down
8 changes: 1 addition & 7 deletions init/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down

0 comments on commit a55f283

Please sign in to comment.