delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/01/20:33:48

From: psmith AT baynetworks DOT com (Paul D. Smith)
Newsgroups: gnu.gcc.help,comp.os.msdos.djgpp
Subject: Re: need help with makefile
Date: 30 Jun 1997 08:47:10 -0400
Organization: Bay Networks, Inc.
Lines: 42
Sender: psmith AT lemming
Message-ID: <p5hgegfeb5.fsf@baynetworks.com>
References: <33b54fa9 DOT 45794318 AT nntpserver DOT swip DOT net>
Reply-To: psmith AT baynetworks DOT com
NNTP-Posting-Host: lemming.baynetworks.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

%% 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019