Heime <[email protected]> writes:
>> >
>> > Make treats the comment "## Make any missing parent directories"
>> > as a command?
>> >
>>
>> ‘make-mode’ is giving you a warning. See (info "(make) Recipe Syntax")
>>
>> * A comment in a recipe is not a 'make' comment; it will be passed to
>> the shell as-is. Whether the shell treats it as a comment or not
>> depends on your shell.
>>
>> If you want to get rid of the warning (which is a good idea
>> so that you do not get too many and fail to see important
>> ones), then you should move it to the end of a shell command
>> or outside of the rule definition:
>
> The warning seems redundant to me when the shell treats it as
> a comment anyway. If Emacs could determine that the shell would
> interpret the part as a comment, no warnings would be necessary.
>
For that concern, you could send a feature request to the
GNU ‘make’ mailing list for reporting errors and requesting
features. See details about that mailing list here:
https://lists.gnu.org/mailman/listinfo/bug-make
There is also the GNU ‘make’ mailing list for questions
about using that tool:
https://lists.gnu.org/mailman/listinfo/help-make
>> 1.
>> $(trgdir)/antares.info: $(srcdir)/antares.texi
>> mkdir -p $(trgdir) # Make any missing parent directories
>> $(MAKEINFO) $(MAKEINFOFLAGS) -o $@ $<
>>
>> 2.
>> # Make any missing parent directories
>> $(trgdir)/antares.info: $(srcdir)/antares.texi
>> mkdir -p $(trgdir)
>> $(MAKEINFO) $(MAKEINFOFLAGS) -o $@ $<
>
> Is it common for a rule to include a shell comment in the command
> part?
In this instance, adding the comment after the command is
the more appropriate location (because your comment is
specific to that command and is not a description of the
makefile rule), but you might decide to have all comments
related to a given rule above each rule.
Note that this works when the shell that you have chosen
allows it. Try:
M-x shell
$ echo "My directory is " ${PWD} #print the current directory
See also (info "(make) Choosing the Shell") if you are
thinking of changing your shell.
--
The lyf so short, the craft so long to lerne.
- Geoffrey Chaucer, The Parliament of Birds.
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.