]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit - Makefile
kbuild: skip parsing pre sub-make code for recursion
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 26 Mar 2019 04:02:19 +0000 (13:02 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 28 Mar 2019 14:46:54 +0000 (23:46 +0900)
commit221cc2d27ddc49b3e06d4637db02bf78e70c573c
tree886060b5f3f242cd763c0ea5c00ef80cda597c6f
parent7265f5b72640f43e558af80347c62e32d568371f
kbuild: skip parsing pre sub-make code for recursion

When Make recurses to the top Makefile with sub-make-done unset,
the code block surrounded by 'ifneq ($(sub-make-done),1) ... endif'
is parsed multiple times. This happens for in-tree building of
include/config/auto.conf, *-pkg, etc. with GNU Make 4.x.

This is a slight regression by commit 688931a5ad4e ("kbuild: skip
sub-make for in-tree build with GNU Make 4.x") in terms of performance
since that code block contains one $(shell ...) invocation.

Fix it by exporting the variable irrespective of sub-make being run.
I renamed it because GNU Make cannot properly export variables
containing hyphens. This is probably a bug of GNU Make, and the issue
in Kbuild had already been reported by commit 2bfbe7881ee0 ("kbuild:
Do not use hyphen in exported variable name").

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Makefile