Re: macro to print filename

"Michal Nazarewicz" <[email protected]> Thu, 02 Jun 2011 21:11:02 +0200
Newsgroups org.kernel.vger.linux-c-programming
Message-ID <op.vwgp8ov63l0zgt@mnazarewicz-glaptop>
On Thu, 02 Jun 2011 20:11:05 +0200, ratheesh kannoth wrote:
> so we could use __FILE__ with Makefile to solve this problem. We could
>  use __FILE__  in our program and define Makefile for each directory.
> From toplevel directory, call using - make -C subdir/ . This will give
> help __FILE__ macro to exapand to just filename since "make" is
> executing inside the directory.

This might not work in included files though.  Also, I'm not sure if
it's guaranteed that __FILE__ is always a relative path.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michal "mina86" Nazarewicz    (o o)
ooo +-----<email/xmpp: [email protected]>-----ooO--(_)--Ooo--