help-make
[Top][All Lists]
Advanced

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

Re: White Space Problems--Again


From: Rick Flower
Subject: Re: White Space Problems--Again
Date: Sat, 28 Mar 2009 10:36:05 -0700
User-agent: Thunderbird 2.0.0.21 (Macintosh/20090302)

Tom Browder wrote:
I know there are words in the Make manual warning about insidious
white space at the ends of strings, but is there any reason that Make
couldn't do trimming during parsing?

I have a Makefile that I've used for a while.  Yesterday I added a
comment and the Makefile stopped working--all because I commented the
end of a definition line.

My first line looked like this (no space after 'gnu'):

  COMPS := gnu

Make reports the value of $(COMPS) as 'gnu'.

Then I added a comment to the line:

  COMPS := gnu # gfortran

Make reports the value of $(COMPS) as 'gnu ', not the same.

It took me a few minutes to figure out what was happening, and in my
stubbornness I added the $(strip) function later for a conditional to
enable me to leave the comment.

Is there any rationale for Make not trimming white space in that
situation?  Or ever?
Tom -

I've run into that same problem with some of my Makefiles and put a big comment in them (for others who might work on the same files) to not put comments on the
same line as a 'make directive' as it seems to mess things up.

HTH!

-- Rick





reply via email to

[Prev in Thread] Current Thread [Next in Thread]