help-make
[Top][All Lists]
Advanced

[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 16:50:36 -0400

%% Edward Peschko <address@hidden> writes:

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

  ep> But that's the problem... 'typically' they do this. What if you
  ep> don't control the makefile? That's no good - I want to be able to
  ep> add to the defaults that people put *in* the makefile.

If they don't provide you a mechanism to do it then there is no way to
do it, other than:

 a) changing the makefile, or

 b) setting CFLAGS to the entirety of their contents, which of course
    doesn't work well if you have recursive make invocations with
    different sets of flags.

  ep> Here's what I want to do: I want to develop a generic 'debug mode'
  ep> for compiling my apps, where I can, on the fly, switch between a
  ep> debugging version and a non-debugging one. And I don't want to
  ep> have to modify every single Makefile in order to do it.

If your makefiles don't have any way to do this already, I'm afraid
you're going to have the change them all at least once, to add a way to
do it.

  ep> Anyways, I propose the following syntax:

  ep> CFLAGS = '$(CFLAGS) -g'

Is this something in the makefile or on the command line?  I'm confused,
because I thought you said you didn't want to change the makefiles but
the above looks like a makefile setting, not a command line setting.

Anyway, that syntax is not acceptable.  It is completely contrary to the
rules that make variables use for expansion.  Plus make does not use
quoting.

  ep> to add to an existing CFLAGS entry inside a makefile, and append
  ep> '-g'. I'm not sure if this is the right place to do it, though,
  ep> and I don't see a developers mailing list.  Where would you post
  ep> feature requests?

This list is fine for discussion.  If you get to the point where you
have a concrete request you can file a bug in Savannah describing it.

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]