Subject: Re: problem with make
From: "Lassi A. Tuura" <[email-masked]>
To: Brian Pollard <[email-masked]>
Cc: "[email-masked]'" <[email-masked]>
Date: Fri, 18 Aug 2000 08:26:40 +0200

> It preserves the trailing spaces when the quotes are not used and I believe
> it shouldn't.  I wrote the email with quotes to emphasize the trailing
> zeros.

(Spaces, not zeros.)  Actually I answered wrong earlier, the fact that
you get spaces has nothing to do with the comment at the end of the
line.  GNU make simply preserves trailing white-space in a variable
value.  In the manual at "Using Variables" -> "Flavors", you'll find:

>>  You can also use [simply expanded variables] to introduce
>>  controlled leading whitespace into variable values.  Leading
>>  whitespace characters are discarded from your input before
>>  substitution of variable references and function calls; this
>>  means you can include leading spaces in a variable value by
>>  protecting them with variable references, like this:
>>
>>     nullstring :=
>>     space := $(nullstring) # end of the line
>>
>>  Here the value of the variable `space' is precisely one
>>  space.  The comment `# end of the line' is included here
>>  just for clarity.  Since trailing space characters are *not*
>>  stripped from variable values, just a space at the end of
>>  the line would have the same effect (but be rather hard to
>>  read).  If you put whitespace at the end of a variable
>>  value, it is a good idea to put a comment like that at the
>>  end of the line to make your intent clear.  Conversely, if
>>  you do *not* want any whitespace characters at the end of
>>  your variable value, you must remember not to put a random
>>  comment on the end of the line after some whitespace, such
>>  as this:
>>
>>     dir := /foo/bar    # directory to put the frobs in
>>
>>  Here the value of the variable `dir' is `/foo/bar    ' (with
>>  four trailing spaces), which was probably not the intention.
>>  (Imagine something like `$(dir)/file' with this definition!)

Live and learn.  Hope that clarifies the issue.  If you have further
questions on this, it would be better to continue the discussion on the
GNU make lists ([email-masked] or [email-masked]), not here.

Cheers,
//lat
-- 
I am ready to meet my Maker.  Whether my Maker is prepared for the
great ordeal of meeting me is another matter.  --Winston Churchill

--
Want to unsubscribe from this list?
Send a message to [email-masked]