On Thu, 2005-05-12 at 02:09 -0700, [EMAIL PROTECTED] wrote:
> when $< is /root/folder1/file1
> I want to change it to /root/file1
> I try
> $(subst folder1/,,$<)
> $(subst folder1\/,,$<)
> and fail

So $(subst) is a function: i.e. it takes some inputs and returns an
output string.   You cannot set $< in a Makefile because it is an
automatic variable, but you can apply a function to it and use the
result in your Makefile.

So for example, $(subst folder1/,,$<) will act on $< and remove folder1
from the string that is in $< and the value of the entire $(subst ...)
will be the value of $< with folder1/ removed.

John.




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

Reply via email to