help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Removing make goals


From: Greg Chicares
Subject: Re: Removing make goals
Date: Sun, 05 Apr 2009 11:08:40 +0000
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

On 2009-04-05 10:49Z, Werner LEMBERG wrote:
> 
> how can I remove a make goal?
> 
> Consider that I have suite of targets `foo-a', `foo-b', ...  Normally
> I would say, for example,
> 
>   make foo-a
> 
> Now imagine that I want to have a special build with a debug target,
> and I want to say
> 
>   make debug foo-a
> 
> The `debug' isn't a real target; I rather test with
> 
>   .PHONY major
>   ifneq ($(findstring debug,$(MAKECMDGOALS)),)
>     ...
>   endif
> 
> to set some flags and the like.

Would it be more natural to make 'debug' a variable instead of a target?
Then you could invoke it like this:
  make debug=1 foo-a
or perhaps:
  make build_type=debug foo-a
and use the variable to set appropriate flags. This resembles the common
  make CFLAGS='-g' foo-a
idiom that everyone would recognize.




reply via email to

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