Skip to content

Commit

Permalink
kbuild: remove auto.conf from prerequisite of phony targets
Browse files Browse the repository at this point in the history
The top-level Makefile adds include/config/auto.conf as
prerequisites of 'scripts', 'prepare1', etc.

They were needed to terminate the build when include/config/auto.conf
is missing.

Now that the inclusion of include/config/auto.conf is mandatory
in the top-level Makefile if dot-config is 1 (Note 'include' directive
is used instead of '-include').

Make terminates the build by itself if it fails to create or update
include/config/auto.conf so we are sure that include/config/auto.conf
exists in the very first stage of make.

I am still keeping include/config/auto.conf as the prerequisite of
%/modules.builtin because modules.builtin is a real file.  According
to commit a6c3663 ("kbuild: Do not unnecessarily regenerate
modules.builtin"), it is intentional to compare time-stamps between
%/modules.builtin and include/config/auto.conf .  I moved tristate.conf
here because it is only included from scripts/Makefile.modbuiltin.

Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
masahir0y committed Jul 25, 2018
1 parent a29d4d8 commit 2063945
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -649,10 +649,6 @@ include/config/auto.conf:
/bin/false)

endif # may-sync-config

else
# Dummy target needed, because used as prerequisite
include/config/auto.conf: ;
endif # $(dot-config)

KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
Expand Down Expand Up @@ -1047,15 +1043,14 @@ define filechk_kernel.release
endef

# Store (new) KERNELRELEASE string in include/config/kernel.release
include/config/kernel.release: include/config/auto.conf FORCE
include/config/kernel.release: $(srctree)/Makefile FORCE
$(call filechk,kernel.release)

# Additional helpers built in scripts/
# Carefully list dependencies so we do not try to build scripts twice
# in parallel
PHONY += scripts
scripts: scripts_basic include/config/auto.conf include/config/tristate.conf \
asm-generic gcc-plugins $(autoksyms_h)
scripts: scripts_basic asm-generic gcc-plugins $(autoksyms_h)
$(Q)$(MAKE) $(build)=$(@)

# Things we need to do before we recursively start building the kernel
Expand Down Expand Up @@ -1085,8 +1080,7 @@ endif
# that need to depend on updated CONFIG_* values can be checked here.
prepare2: prepare3 outputmakefile asm-generic

prepare1: prepare2 $(version_h) $(autoksyms_h) include/generated/utsrelease.h \
include/config/auto.conf
prepare1: prepare2 $(version_h) $(autoksyms_h) include/generated/utsrelease.h
$(cmd_crmodverdir)

archprepare: archheaders archscripts prepare1 scripts_basic
Expand Down Expand Up @@ -1224,7 +1218,7 @@ modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
$(Q)$(AWK) '!x[$$0]++' $^ > $(objtree)/modules.builtin

%/modules.builtin: include/config/auto.conf
%/modules.builtin: include/config/auto.conf include/config/tristate.conf
$(Q)$(MAKE) $(modbuiltin)=$*


Expand Down

0 comments on commit 2063945

Please sign in to comment.