help-make
[Top][All Lists]
Advanced

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

Re: -n option executes commands; bug?"


From: Paul D. Smith
Subject: Re: -n option executes commands; bug?"
Date: Mon, 23 Jun 2003 17:51:45 -0400

%% gk <address@hidden> writes:

  g> At 04:40 PM 6/23/2003 -0400, Paul D. Smith wrote:

  >> The `-n', `-t', and `-q' options do not affect command lines that
  >> begin with `+' characters or contain the strings `$(MAKE)' or
  >> `${MAKE}'.  Note that only the line containing the `+' character or the

  g> So, to make sure rules NEVER get executed with -n, the solution is:
  g> remove $(MAKE) from the rule

  g> define cmd
  g> $(MAKE) -p $(1)
  g> endef
  g> foo:
  g>          @$(call cmd,$@) 1>$@

Right.  But why do you use define or call here?  Simpler to just use a
straight assignment:

  _MAKE = $(MAKE)
  foo:
        $(_MAKE) -p $@ 1>$@

Or maybe:

  _MAKE = $(MAKE) -p
  foo:
        $(_MAKE) $@ 1>$@

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