This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: __BASENAME__?
- From: John Love-Jensen <eljay at adobe dot com>
- To: John Breitenbach <breiten at lexmark dot com>, GCC-help <gcc-help at gcc dot gnu dot org>
- Date: Fri, 24 Oct 2008 07:01:05 -0500
- Subject: Re: __BASENAME__?
Hi John
> Does gcc have a way to emit just the basename of __FILE__?
Sort of.
This command line:
g++ test.cpp
Results in this __FILE__
"test.cpp"
This command line:
g++ ~/dev/breitenbach/test.cpp
Results in this __FILE__
"/home/eljay/dev/breitenbach/test.cpp"
(The '~' is pre-expanded to $HOME by my shell.)
So you pretty much get what you give.
HTH,
--Eljay