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