Mail Archives: djgpp/1997/10/12/21:28:24
At 08:10 10/11/1997 -0700, Rik Blok wrote:
>I have a makefile with the line
>
> CFLAGS += -I$(INCLUDE_LIBS)
>
>and I sometimes want to call the makefile with CFLAGS preset
>
> make CFLAGS=-g
>
>but this seems to override CFLAGS instead of just initializing it. How
>can I make this result in
>
> CFLAGS = -g -I$(INCLUDE_DIRS)
>
>I'm new to make and any help would be appreciated.
A traditional solution is to do something like:
CFLAGS = $(OVERRIDE_CFLAGS) -I$(INCLUDE_DIRS)
and say
make OVERRIDE_CFLAGS=-g
> Rik Blok
>
>P.S. Is it possible to copy an implicit rule? For example, is there a
>generic way to copy the rule for %:%.o to %.exe:%.o?
No. You will probably have to write it yourself. (It's usually a bad idea to
depend on implicit rules anyway, IMHO).
Nate Eldredge
eldredge AT ap DOT net
- Raw text -