[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: conditional macro definitions
From: |
Paul D. Smith |
Subject: |
Re: conditional macro definitions |
Date: |
Sun, 20 Nov 2005 08:35:06 -0500 |
%% bill <address@hidden> writes:
b> The syntax
b> foo:=CFLAGS=-DFOO
b> for redefining CFLAGS for the target foo seems like a great thing, but
b> it's not valid in gnu-make. I'm currently setting up my make files so
b> that I type "make DEBUG=1" and then defining CFLAGS conditionally based
b> on the definition of DEBUG. I'd much rather type "make debug" and use
b> the syntax given above. 2 questions:
b> 1) Is it possible to do something like:
b> if target==debug; CFLAGS = -DDEBUG; end if
b> rather than:
b> ifdef DEBUG; CFLAGS = -DDEBUG; end if
b> 2) Why is the conditional macro definition syntax not incorporated into
b> gnu-make? It seems like a good idea.
Look up target-specific variables in the GNU make manual.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist