GNU bug report logs - #46052
Colons fooling GNUmakefile mode

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Sat, 23 Jan 2021 12:01:02 UTC

Severity: normal

Tags: confirmed, patch

Merged with 17400, 33681, 33900, 35299, 36245, 37934, 45037, 46221, 48052, 76759

Found in version 26.1

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Kévin Le Gouguec <kevin.legouguec <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 46052 <at> debbugs.gnu.org, jidanni <at> jidanni.org
Subject: bug#46052: Colons fooling GNUmakefile mode
Date: Sat, 23 Jan 2021 15:58:58 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

> I'm not sure a target line cannot possibly start with a TAB.

I'll admit to not being an expert in makefile syntax; I do find this
entry in (info "(make) Error Messages") encouraging though:

> 'recipe commences before first target. Stop.'
> 'missing rule before recipe. Stop.'
>      This means the first thing in the makefile seems to be part of a
>      recipe: it begins with a recipe prefix character and doesn't appear
>      to be a legal 'make' directive (such as a variable assignment).
>      Recipes must always be associated with a target.

While that phrasing doesn't rule out subsequent targets from starting
with a TAB, empirically that seems to be the case:

#+begin_src makefile
foo:
	echo foo

	bar:
	echo bar
#+end_src

$ make
echo foo
foo
bar:
make: bar:: No such file or directory
make: *** [makefile:3: foo] Error 127

#+begin_src makefile
foo:
	echo foo

QUUX = CORGE

	bar:
	echo bar
#+end_src

$ make
makefile:6: *** recipe commences before first target.  Stop.




This bug report was last modified 73 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.