Re: Emacs makefile mode - Commented text turns tab pink

[email protected]
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
Heime <[email protected]> writes:

>> > I made a makefile with some comments. In Emacs the tab of the
>> > comment turns pink.  An I doing something wrong?
>> >
>> > $(trgdir)/antares.info: $(srcdir)/antares.texi
>> > 	## Make any missing parent directories
>> > 	mkdir -p $(trgdir)
>> > 	$(MAKEINFO) $(MAKEINFOFLAGS) -o $@ $<
>> 
>> make-mode.el says:
>> 
>> 	    ;; Highlight shell comments that Make treats as commands,
>> 	    ;; since these can fool people.
>> 	    ("^\t+#" 0 makefile-space t)
>> 
>
> 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:

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 $@ $<

-- 
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.