delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/13/11:53:48

Date: Mon, 13 Oct 1997 11:52:27 -0400 (EDT)
From: "Art S. Kagel" <kagel AT ns1 DOT bloomberg DOT com>
Reply-To: kagel AT ns1 DOT bloomberg DOT com
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.D-G.3.96.971013115021.18346F-100000@dg1>
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)

In your makefile, initialize CFLAGS=$(CFINIT) and CFINIT=-O2 (or
somesuch) then you can change the initial value of CFLAGS with:

make CFINIT=-g

and your append command will still work.

Art S. Kagel, kagel AT bloomberg DOT com

- Raw text -


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