Date: Sun, 12 Oct 1997 18:25:35 -0700 (PDT) Message-Id: <199710130125.SAA20102@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: Rik Blok , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: updating command-line variables in make? Precedence: bulk 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