help-make
[Top][All Lists]
Advanced

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

Re: help with implicit rules


From: Miguel Guedes
Subject: Re: help with implicit rules
Date: Thu, 22 Nov 2012 09:00:38 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2

On 21/11/12 09:38, Philip Guenther wrote:
To quote the GNU make info pages:
-------
A "substitution reference" substitutes the value of a variable with
alterations that you specify.  It has the form `$(VAR:A=B)' (or
`${VAR:A=B}') and its meaning is to take the value of the variable VAR,
replace every A at the end of a word with B in that value, and
substitute the resulting string.
-------

I.e., "VAR" has to be the name of a variable.  So, given
    all: $($(wildcard *.page):.page=.html)

make expands "$(wildcard *.page)" *and then treats the result as the
name of a variable*.  Since your makefile doesn't have a variable with
the name "whatever.page another.page something.page etc.page", the
result is empty.

To do a pattern substitution on something other than the result of a
variable expansion, use the $(patsubst) function directly:

all: $(patsubst %.page,%.html,$(wildcard *.page))

Ah, thank you for that, Philip! Makes sense now.


--
Miguel



reply via email to

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