On Tue, 2010-03-23 at 09:58 -0700, RusMor wrote:
> blaat:
> blaat.blaat:
> 
> TEST = $(1).$(1)
> 
> test/%: $(call TEST,%)
>       @echo "Args = $^"

> yt...@moniac:~/scratch> make test/blaat
> make: *** No rule to make target `test/blaat'.  Stop.
> 
>   I do not understand why the call to the TEST function (in the test/% rule)
> with parameter "%" does not do the same as the call (in the print/% rule) to
> the same function with parameter "$<", which is derived from "%" ??

You need to check the GNU make manual section "How `make' Reads a
Makefile".

Basically, the $(call ...) here is being evaluated when the makefile is
read in, long before make starts using the pattern rule to match against
the command you have entered.

So, make is running the $(call ...) function with the literal string
"%", which expands to %.%, so make sees this pattern rule:

        test/%: %.%

Now, multiple patterns are not interpreted in pattern rules (don't know
why) so this basically says, for a target "test/blaat", it depends on
"blaat.%" of which there isn't one.

To get this to work you'll have to enable secondary expansion I think;
see the GNU make manual for more details/examples.



_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to