delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/12/11:02:49

From: Rik Blok <blok AT physics DOT ubc DOT ca>
Newsgroups: comp.os.msdos.djgpp
Subject: updating command-line variables in make?
Date: Sat, 11 Oct 1997 20:10:16 -0700
Organization: Lynx Internet
Lines: 24
Message-ID: <34403F98.699BFBAF@physics.ubc.ca>
NNTP-Posting-Host: lynx1042.lynx.bc.ca
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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.
	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?  

-- 
Rik Blok  <blok AT physics DOT ubc DOT ca>
Department of Physics and Astronomy,
University of British Columbia, Canada
http://www.physics.ubc.ca/~blok

- Raw text -


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