Mail Archives: djgpp/1997/07/01/20:33:48
%% Robert DOT Fremin DOT 3801 AT student DOT uu DOT se (Robert Fremin) writes:
Note that make questions belong on the gnu.utils.bugs or gnu.utils.help
lists.
rf> What I want is to be able to type 'make debug'
rf> for a debug version, and just 'make' for normal
rf> working version.
There is only one way way you can do that, if that's exactly what you
want:
CFLAGS += $(CDEBUG)
all: $(exe)
...
debug:
$(MAKE) CDEBUG=-Ddebug_mode
Thus, when you say "make debug" it re-invokes make with the CDEBUG flag
set. When you just say "make", it runs the regular rules and CDEBUG is
not set.
If you don't want to use a reinvocation you must use a different
command-line syntax; say:
ifdef DEBUG
CFLAGS += -Ddebug_mode
endif
all: $(exe)
...
then you can run "make DEBUG=yes" or something.
--
-------------------------------------------------------------------------------
Paul D. Smith <psmith AT baynetworks DOT com> Network Management Development
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
These are my opinions--Bay Networks takes no responsibility for them.
- Raw text -