help-make
[Top][All Lists]
Advanced

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

Re: Removing make goals


From: John Calcote
Subject: Re: Removing make goals
Date: Sun, 05 Apr 2009 12:39:19 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1b3pre) Gecko/20090223 Thunderbird/3.0b2

Werner,

On 4/5/2009 4:49 AM, Werner LEMBERG wrote:
Doing so works fine, however, make says something like

   nothing to be done for `debug'

Currently, I do

   .PHONY major
   ifneq ($(findstring debug,$(MAKECMDGOALS)),)
     ...
     debug:
             @:
   endif
I've dealt with large GNU make files, and this is exactly what we do. Inelegant it may be, but it solves the problem. The trouble is that we're really trying to overload the function of a make goal. Instead of building something called "debug" with a debug goal, we're trying to define something like a pseudo-goal, which adds functionality to the real goal - "target".

One way around this would be to define a real goal called "debug-target", which sets additional flags, and then calls $(MAKE) on "target" with appropriate debug command line flags. Unfortunately, make is just flexible enough to allow us to do things with it that were never originally intended, but not quite flexible enough to have these extension operations be first-class extensions.

Regards,
John




reply via email to

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