[Top][All Lists]

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

Re: Makefile mode's sh comment non-exactness

From: Kevin Rodgers
Subject: Re: Makefile mode's sh comment non-exactness
Date: Mon, 30 Aug 2004 09:59:50 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv: Gecko/20020406 Netscape6/6.2.2

Dan Jacobson wrote:
> Makefile mode's colors show that it thinks this
>    cd $?.d && sed /^#/d ../$?|wget -w 2 ...
> is a comment starting at #.

It may be, depending on how one reads the GNU make manual (Makefile

|    * `#' 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.

The POSIX Single Unix Specification for the make command (see the
Rationale) is clearer:

| Early proposals stated that an "unquoted" number sign was treated as
| the start of a comment.  The make utility does not pay any attention
| to quotes.  A number sign starts a comment regardless of its
| surroundings.

> Yes I could use
>    cd $?.d && sed '/^#/d' ../$?|wget -w 2 ...
> but then my friends would think I was silly.

But then the shell would at least execute the sed command.

Kevin Rodgers

reply via email to

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