help-make
[Top][All Lists]
Advanced

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

Re: a small question about subst


From: Paul D. Smith
Subject: Re: a small question about subst
Date: Thu, 12 May 2005 16:14:10 -0400

%% Regarding a small question about subst; you wrote:

  n> I have a small question about subst in makefile
  n> script,

  n> when $< is /root/folder1/file1
  n> I want to change it to /root/file1
  n> I try
  n> $(subst folder1/,,$<)
  n> $(subst folder1\/,,$<)
  n> and fail

You haven't given us nearly enough information to help you.  What
version of GNU make are you using?  What does "fail" mean (what actually
happens?)  How are you using this, exactly?  Please provide a small
_real_ makefile example where it fails.

As far as I can tell, subst does exactly what is expected:

    $ echo 'all: ; @echo $(subst folder1/,,/root/folder1/file1)' | make -f-
    /root/file1

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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