bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Further strange behavior of the parser


From: Henning Makholm
Subject: Further strange behavior of the parser
Date: Fri, 13 Dec 2002 01:06:49 +0100
User-agent: Mutt/1.4i

Further strange behavior that becomes apparent while I read through
the code:

pc-043:~/tmp/foo$ cat Makefile
A = all::
B = all::
$(A)
        : aaa
$(B) ; : bbb
pc-043:~/tmp/foo$ gmake
: aaa
: bbb
pc-043:~/tmp/foo$ gmake A="all:: ; : xxx"
: xxx
: aaa
: bbb
pc-043:~/tmp/foo$ gmake B="all:: ; : xxx"
Makefile:5: *** target pattern contains no `%'.  Stop.
pc-043:~/tmp/foo$

An uninitiated user (who has been initiated enough to know that
separators can result from variable expansion) would expect the last
run to have the $(B) rule expanded to

  all :: ; : xxx ; : bbb

resulting in

$ gmake B="all:: ; : xxx"
: aaa
: xxx ; : bbb
$

but this don't happen: Semicolons in variable expansions are not
recognized as special character when a semicolon has already been
identified *before* any expansion was attempted (read.c, just before
the first "Look for a semicolon in the expanded line" comment).

Instead make thinks that the ";" is supposed to be the pattern part of
a static pattern rule, and produces the above error message.

-- 
Henning Makholm                                 "Slip den panserraket og læg
                                          dig på jorden med ansigtet nedad!"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]