%% gk <[EMAIL PROTECTED]> writes:

  g> It appears that $(if ) does not allow semi-colon inside $(shell )
  g> function?  There is no problem with my rule since 'make recurse'
  g> works when the $(if ) function is removed.

  g> --- From command shell I execute:
  g> $export RECURSE=1
  g> $make
  g> Makefile:3: *** unterminated call to function 'if': missing ')'. Stop.

It doesn't matter whether RECURSE is set or not; you'll still get the
same problem.  This is a parsing issue, not a command invocation issue.

  g> $(if $(RECURSE), $(shell RECURSE=; $(MAKE) recurse ) )

This is a bug; please report it on the make project on Savannah
(savannah.gnu.org).

There are any number of ways to avoid it, though; note that Bourne shell
syntax allows variables to be set in the same command line, like this:

  $(if $(RECURSE), $(shell RECURSE= $(MAKE) recurse ) )

Or you could use make's capability of setting variables on the command
line, rather than relying on the shell:

  $(if $(RECURSE), $(shell $(MAKE) recurse RECURSE= ) )

Or you could put this into a variable assignment, where it won't be
parsed as a possible rule:

  _x := $(if $(RECURSE), $(shell RECURSE=; $(MAKE) recurse ) )

This is typically how $(shell ...) would be used, otherwise the output
of the make command would be considered make syntax which should be
parsed, which is probably not what you want.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          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


_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to