[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why does "manual%.html" match "manual.html" in some cases but not ot
From: |
Philip Guenther |
Subject: |
Re: Why does "manual%.html" match "manual.html" in some cases but not others? |
Date: |
Mon, 22 Mar 2010 18:56:47 -0700 |
On Mon, Mar 22, 2010 at 1:23 PM, Jack Bates <address@hidden> wrote:
> Why does "manual%.html" match "manual.html" in the case of
> $(patsubst ../manual%.html,...) and ".PRECIOUS: manual%.html", but not
> in the case of the target, "manual%.html: ..."?
Hmm, it appears to have been like that for a long time and the
behavior is documented (c.f. section 10.5, "Defining and Redefining
Pattern Rules"). The question is whether it should be counted a bug.
I was going to hazard the guess that it's for compatibility with
pattern rules in some other version of make, but a quick check shows
that Solaris's normal make as well as its backwards compatibility
"sysv-make" both permit '%' to match the empty string in pattern
rules, so if it _was_ for cross-version compatibility then it was with
some other (even more ancient?) version. As is, changing it to permit
% to match empty strings seems like the Right Thing to me.
...
> Unfortunately the "manual%.pdf" and "manual%.html" targets don't match
> "manual.pdf" and "manual.html", respectively
Workaround: require the % to match the 'l' too, ala "manua%.pdf" and
"manua%.html". Gross, but it works...
Philip Guenther