]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitb5453cfd57266d3cea178ad74223a3f1754d8d53
tree886060b5f3f242cd763c0ea5c00ef80cda597c6f
parent78acab605c25b41e93d8e27060b1b178474e8fc5
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 f0c3d359f124 ("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 5d7cb2da3daf ("kbuild:
Do not use hyphen in exported variable name").

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