makefile - Does a '%' in a pattern match an empty string? -


from docs:

a vpath pattern 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, %.c pattern matches file name ends in .c. s.%.c pattern matches file name starts s., 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

Popular posts from this blog

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -