Re: macro to print filename

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


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: mnazarewicz@xxxxxxxxxx>-----ooO--(_)--Ooo--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux