Makefile: fix performance regression caused by the umask handling
authorGuido Martínez <guido@vanguardiasur.com.ar>
Thu, 16 Jul 2015 22:33:07 +0000 (00:33 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sat, 18 Jul 2015 09:31:38 +0000 (11:31 +0200)
commit1e9f60471622ec48f4df9ffe09e6cbca3a3ca6aa
treed49aa9b24e078fef6cbddc6edf71a7f241d2a12e
parentabf422ae0a523ac24bcd07aec6748bc9d2f706bc
Makefile: fix performance regression caused by the umask handling

Commit bee5745c introduced an extra level of 'make' when the umask is
different from 0022. However, when several targets were specified on
the command line, a new make instance would be called for each target.
This introduces a huge performance overhead when many targets are
specified on the command line.

To fix this, use the same approach as used in the mkmakefile script:
an addition target on which the MAKECMDGOALS depend, so that this
target is run only once.

Note that the mkmakefile script contains a special exception for
Makefile, because the Makefile in the output directory is generated.
Since the top-level Makefile is not generated, this exception is not
needed here.

While we're at it, also fix the whitespace in the UMASK assignment.

Signed-off-by: Guido Martínez <guido@vanguardiasur.com.ar>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
[yann.morin.1998@free.fr: aggregate patches from Arnout and Guido]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Makefile