This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: problem with make


> 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 (help-make@gnu.org or bug-make@gnu.org), 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 cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]