[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: adding to existing makefile variables
From: |
Paul D. Smith |
Subject: |
Re: adding to existing makefile variables |
Date: |
Wed, 4 Jun 2003 02:06:28 -0400 |
%% "Peschko, Edward" <address@hidden> writes:
pe> How do you 'reach in and grab' a makefile variable, and then add
pe> to it?
You can't, not that way. Command line settings, even if done with +=,
take complete precedence over makefile settings. You _can_ do this in
your makefile:
override CFLAGS += -O
then no matter what you add on the command line:
make CFLAGS=-g
you'll still get the values in the makefile. But if you use override
there's no way to override it from the command line.
Typically people reserve variables like CFLAGS, etc. for users to use
and don't set them inside their makefiles, but instead use other
variables for those, then include both in the compile line.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist