delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/13/08:39:07

Date: Mon, 13 Oct 1997 14:36:16 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Rik Blok <blok AT physics DOT ubc DOT ca>
cc: djgpp AT delorie DOT com
Subject: Re: updating command-line variables in make?
In-Reply-To: <34403F98.699BFBAF@physics.ubc.ca>
Message-ID: <Pine.SUN.3.91.971013143530.11407C-100000@is>
MIME-Version: 1.0

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 -


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