Trevor Jenkins <[EMAIL PROTECTED]> wrote in
[EMAIL PROTECTED]:">news:[EMAIL PROTECTED]: 

> On Fri, 12 Apr 2002, Paul D. Smith <[EMAIL PROTECTED]> wrote:
> 
>> %% Trevor Jenkins <[EMAIL PROTECTED]> writes:
>>
>>   tj> I'm trying to understand the use of # in makefiles.
>>
>> Any occurance of a literal "#" in the makefile is considered a
>> comment except in the following situations:
> 
>> Using backslash to escape the comment character is the official
>> method. This is even required by the POSIX standard for make.  If the
>> docs don't make this clear, there's a bug there.
> 
> Here's all I could find the docs to say:
> 
>|* `#' in a line of a makefile starts a "comment".  It and the rest of
>|     the line are ignored, except that a trailing backslash not
>|     escaped by another backslash will continue the comment across
>|     multiple lines.  Comments may appear on any of the lines in the
>|     makefile, except within a `define' directive, and perhaps within
>|     commands (where the shell decides what is a comment).  A line
>|     containing just a comment (with perhaps spaces before it) is
>|     effectively blank, and is ignored.
> 
> No mention of a backslash there as an escape for the #.  And just to
> be certain, in case my version of make is older, I checked the text at
> http://www.fsf.org/manual/make/html_node/make_14.html#SEC13 it too
> does not mention the escape route either.

I've read the make manual many times and so I think that this omission
IS a documentation 'bug'. 

I, also, did not know until reading this thread, that a backslash would
be used to escape the meaning of a '#' to make. I would naturally have
tried that, I suppose, at some point along the line, if i had been faced
with the requirements that Trevor was. But it wouldn't have been easy to
figure out since it isn't orthogonal with the rest of make: '\$' doesn't
escape a dollar sign, for example (only '$$' -- doubled dollars -- allow
a symbol starting with '$' to be unmolested by make). 

  Best,
   Soren A







_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to