help-make
[Top][All Lists]
Advanced

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

Re: String manipulation: Strip paths from file names?


From: Stephan Beal
Subject: Re: String manipulation: Strip paths from file names?
Date: Thu, 18 Jun 2009 17:42:39 +0200

On Thu, Jun 18, 2009 at 12:06 AM, Ken Klein<address@hidden> wrote:
> I have a string variable in my make file that is set to several file names
> seperated by spaces. The names include the file paths, e.g., ".../file.cpp
> ../../file2.cpp ../DIR/file3.cpp". In my makefile, I need to convert that to
> a string of just the file names, e.g., "file.cpp file2.cpp file3.cpp".
> Anyone know how to do that? I looked at the gnu string manipulation
> functions, but none seemed to be the answer.

You were so close! Look through the File Name Functions instead of the
String functions:

http://www.gnu.org/software/make/manual/make.html#File-Name-Functions

you want $(notdir ...), i think.

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/




reply via email to

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