]> git.ipfire.org Git - thirdparty/make.git/commit
[SV 35711] Check for special targets earlier
authorPaul Smith <psmith@gnu.org>
Fri, 27 Nov 2020 16:37:29 +0000 (11:37 -0500)
committerPaul Smith <psmith@gnu.org>
Sun, 29 Nov 2020 22:55:02 +0000 (17:55 -0500)
commitc01222c0181f9bb4297459663d13444ebfe3ad97
tree08cf64c970984796416387e1a8214a8d7d6b04e9
parent957aa450a073796513f9d4d815ef36ad00823be0
[SV 35711] Check for special targets earlier

GNU make must recognize some special targets as they are defined.
Because of the way targets are defined, we were not recognizing these
special targets until we were handling the NEXT statement.  However
that's too late for some special targets such as .POSIX etc. which can
change the behavior of make during parsing.

Check for special targets earlier, as soon as we've finished parsing
the target introduction line (before we've even parsed the recipe).

* NEWS: Mention the change.
* src/read.c (check_specials): New function to look for special
targets.  Move checks from eval() and record_files() to this new
function.
(eval): Call check_specials() after we've completed parsing the target
introduction line.  Move default goal detection to check_specials().
(record_files): Move handling of .POSIX, .SECONDEXPANSION, and
.ONESHELL to check_specials().
* tests/scripts/misc/bs-nl: Remove workaround for late .POSIX issue.
* tests/scripts/targets/POSIX: Add a comment.
NEWS
src/read.c
tests/scripts/misc/bs-nl
tests/scripts/targets/POSIX