Energon
04-26-2001, 08:04 PM
How do I setup an external define using a Makefile? I have this in my Makefile:
DEBUG=_DEBUG
...
$(CXX) -o .... -g -D$(DEBUG)
and when I do a `make debug`, I get this:
g++ -o .... -g -D_DEBUG
which looks to me like _DEBUG should now be defined, but in my code where I have:
#if defined _DEBUG
...
#endif
the code never gets executed... what am I doing wrong? I'm trying to write some code that syncs in both Windows and Linux and I have my Debug build setup to define _DEBUG in Windows, and I want that same kind of functionality here...
DEBUG=_DEBUG
...
$(CXX) -o .... -g -D$(DEBUG)
and when I do a `make debug`, I get this:
g++ -o .... -g -D_DEBUG
which looks to me like _DEBUG should now be defined, but in my code where I have:
#if defined _DEBUG
...
#endif
the code never gets executed... what am I doing wrong? I'm trying to write some code that syncs in both Windows and Linux and I have my Debug build setup to define _DEBUG in Windows, and I want that same kind of functionality here...