makefile - Does a '%' in a pattern match an empty string? -
from docs:
a
vpathpattern string containing%character. string must match file name of prerequisite being searched for,%character matching sequence of 0 or more characters (as in pattern rules).
now, although, true % match empty string (string of 0 length) in vpath pattern (vpath % foo), not true pattern-rules.
so, wrong documentation above, equate between them, as:
...the '%' character matching sequence of 0 or more characters (as in pattern rules.
as not true, evident following makefile:
all :: al%l : @echo '$@'
.
executing, get:
# evident 'all' doesn't match 'al%l' $ make -r make: nothing done 'all'. # but, 'all' match 'al%' $ make -r -f makefile -f <(echo 'al% : ; echo $@') echo all
.
in fact, documented:
for example,
%.cpattern matches file name ends in.c.s.%.cpattern matches file name startss., ends in.c, @ least 5 characters long. (there must @ least 1 character match%.) substring%matches called "stem".
agree?
yes, does.
the problem in example mixing , matching single vs. double colon recipes. explicitly not allowed, need 1 or other matching rules.
also, having different patterns not qualify being same target , specific match run , others ignored (even if 0 width match in example might present).
Comments
Post a Comment