[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
conditional macro definitions
From: |
bill |
Subject: |
conditional macro definitions |
Date: |
Sun, 20 Nov 2005 07:50:39 +0000 |
User-agent: |
Mozilla Thunderbird 1.0.7-1.1.fc3 (X11/20050929) |
The syntax
foo:=CFLAGS=-DFOO
for redefining CFLAGS for the target foo seems like a great thing, but
it's not valid in gnu-make. I'm currently setting up my make files so
that I type "make DEBUG=1" and then defining CFLAGS conditionally based
on the definition of DEBUG. I'd much rather type "make debug" and use
the syntax given above. 2 questions:
1) Is it possible to do something like:
if target==debug; CFLAGS = -DDEBUG; end if
rather than:
ifdef DEBUG; CFLAGS = -DDEBUG; end if
2) Why is the conditional macro definition syntax not incorporated into
gnu-make?
It seems like a good idea.