Without seeing your code, I can only assume that you are trying to do
this in the command section of a rule. If that is the case, you'll need
to use sed or something similar. The GNU make functions will be
processed when the files are read and not when the targets are run. At
that time, $< has no value and your statements evaluate to the empty
string.
Here is a simple example
my_root=root
file1.out: $(my_root)/folder1/file1
@echo "modified prerequisite=\"`echo $< | sed -e 's/folder1\///'`\""
root/folder1/file1:
mkdir -p $(@D)
touch $(@)
Ken
On Thu, May 12, 2005 at 02:09:48AM -0700, [EMAIL PROTECTED] wrote:
> Hi,
> I have a small question about subst in makefile
> script,
>
> when $< is /root/folder1/file1
> I want to change it to /root/file1
> I try
> $(subst folder1/,,$<)
> $(subst folder1\/,,$<)
> and fail
>
> Thanks for advise
> gan
>
>
>
>
> __________________________________
> Yahoo! Mail Mobile
> Take Yahoo! Mail with you! Check email on your mobile phone.
> http://mobile.yahoo.com/learn/mail
>
>
> _______________________________________________
> Help-make mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/help-make
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make