help-make
[Top][All Lists]
Advanced

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

RE: Why does one work ant the other doesn't $(foreach


From: Paul D. Smith
Subject: RE: Why does one work ant the other doesn't $(foreach
Date: Tue, 28 Mar 2006 08:21:06 -0500

%% "PATTON, BILLY \(SBCSI\)" <address@hidden> writes:

  pb> A shorter version
  pb> Works
  pb> $(foreach var,$(list)

  pb> Fails
  pb> $(foreach var\
  pb>   ,$(list)

  pb> Fails
  pb> $(foreach var,\
  pb>   $(list)

None of the above are syntactically correct examples.  Please always
provide a _WORKING_ example (unless it requires a huge
infrastructure--in which case please trim it), rather than a non-working
paraphrasing.  It requires significantly more work for us to reproduce
the problem if your example is not complete.

Please read: http://www.catb.org/~esr/faqs/smart-questions.html


Of the above, only the second one fails for me; the first and third work
fine.  Please provide a complete example of the failure in the third
case if you want us to look at it.

The second one fails because, like all functions etc., while leading
whitespace is stripped trailing whitespace is preserved.  That means
that the loop variable in the foreach function is not "var", but rather
"var    ".  So any reference to $(var) in the loop body will evaluate to
empty.

I agree that this is probably not worth supporting: please file an
enhancement request in the Savannah project to get this changed.  It
won't be changed for 3.81 though; it's too late for that now.

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