using environment variable: gcc -D vs. #define
Hi y'all! I have some defines like this:
That I use like this (eg):
#define DIR "path"
#define FILE "file"
No problem. However, I want to include another define that is passed to the compiler on the command line or in a makefile, taken from an environment variable, eg:
But different rules seem to apply because of the shell and special characters such as '/'. I could do this:
Which prevents the shell screwing up on "/", but I cannot include an environment variable in single quotes for the same reason -- the shell will then just pass '$WROOT' thru literally.
Anyone know of a way around this?