Never put comments in a rule.
make treat anything starting with a tab as a command for
the current rule, even if the tab is immediately followed by a
make from Tru64 Unix V5.1 is one of them. The following
# foo through the shell.
all: # foo
As a workaround, you can use the
: no-op command with a string
argument that gets ignored:
all: : "foo"
Conversely, if you want to use the ‘#’ character in some command,
you can only do so by expanding it inside a rule (see Comments in Make Macros). So for example, if ‘COMMENT_CHAR’ is substituted by
config.status as ‘#’, then the following substitutes
‘@COMMENT_CHAR@’ in a generated header:
foo.h: foo.h.in sed -e 's|@''COMMENT_CHAR''@|@COMMENT_CHAR@|g' \ $(srcdir)/foo.h.in > $@
The funny shell quoting avoids a substitution at
run time of the left-hand side of the
sed ‘s’ command.