[Top][All Lists]

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

Re: make-3.81 question (diff)

From: Paul D. Smith
Subject: Re: make-3.81 question (diff)
Date: 13 Apr 2006 17:12:17 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

%% "James" <> writes:

  j> all: def
  j>         for f in q.d z.d; do echo $$f $(if $(call 
Diff,sub/$$f,sub2),diff,same); done

Remember: _all_ make expansion of variables, etc. is done _FIRST_, then
the result of the expansion is passed to the shell.  Then make just
waits for the shell to exit.

Here you have a mixture: you have make functions that are trying to use
the value of a shell loop variable $f, but that can't work because all
expansion of make functions is done well before the shell is even

You have to rewrite your rule so that either it does the test in the
shell using shell's "if", or it does everything in make functions (using
make's looping with $(foreach ...)).

 Paul D. Smith <>          Find some GNU make tips at:            
 "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]