help-make
[Top][All Lists]
Advanced

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

Re: Problem with substitution reference


From: Paul Smith
Subject: Re: Problem with substitution reference
Date: Wed, 24 Sep 2008 16:27:38 -0400

On Wed, 2008-09-24 at 13:20 -0700, Greg Ortiz wrote:
> Getting a 'target pattern contains no '%' from running a simple make.
> Running make from OpenSuse using GNU make 3.8.1.  Any help would be
> greatly appreciated.

You mean 3.81.  There is no 3.8.1.  Also, please choose ONE mailing list
rather than all of them :-)

> Makefile
> ------------------
> hello: 
>     echo $@
>     make -f include.mk hello
>  
> include.mk
> ------------------
> hello: hello.o
>      cc -c hello.c
>  
> hello.o: $${@:%.o=%.c}
>   cc -c hello.c

If you want to use secondary expansion in GNU make 3.81 you have to set
the pseudo-target .SECONDEXPANSION: in your makefile somewhere.

See the 'Secondary Expansion' section of the GNU make manual.






reply via email to

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