help-make
[Top][All Lists]
Advanced

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

Re: Question on targets and goals


From: Greg Chicares
Subject: Re: Question on targets and goals
Date: Mon, 08 Aug 2011 11:57:01 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10

On 2011-08-08 10:51Z, Jeffrey Walton wrote:
> 
> I would like to invoke make with a debug or release configuration, but
> without a rule:
>     `make debug` or `make release`
> 
> Later:
> 
> ifeq ($(MAKECMDGOALS),debug)
>   CXXFLAGS += -DDEBUG=1 -g3 -ggdb -O0
> endif
> 
> Because I don't have a rule, I'm getting a make error:
>     make: *** No rule to make target `debug'.  Stop.
> 
> So I think I've figured out how *not* to do it.
> 
> I need to pick up debug or release, then invoke the `all` rule.  Can
> anyone suggest a way that works?

Untested:

`make build_type=debug all` or `make build_type=release all`

ifeq (debug,$(findstring debug,$(build_type)))
  CXXFLAGS += -DDEBUG=1 -g3 -ggdb -O0
endif



reply via email to

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