Mail Archives: djgpp/1997/10/13/08:39:07
On Sat, 11 Oct 1997, 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)
Use the "override" directive in your Makefile, like so:
override CFLAGS += -I$(INCLUDE_LIBS)
This is all described in the Make manual; from the DOS prompt type
"info make 'using variables' override" and read there. (Note the
single quotes around 'using variables': they are important.)
- Raw text -