Re: Suffix rules and prerequisites

Paul Smith <[email protected]> Wed, 22 Apr 2026 12:47:08 -0400
Newsgroups gmane.comp.gnu.make.general
Organization GNU's Not UNIX!
Message-ID <[email protected]>
On Wed, 2026-04-22 at 18:59 +0300, Eli Zaretskii wrote:
> > .in: bar
> > =C2=A0 test -f bar
> > =C2=A0 cat bar > $@
>=20
> According to the GNU Make manual, suffix rules cannot have
> prerequisites.=C2=A0 See the node "Suffix Rules" in the manual.

Also, POSIX does not allow this so if bmake does, it's an extension to
POSIX that GNU Make does not support.

https://pubs.opengroup.org/onlinepubs/9799919799/utilities/make.html#tag_20=
_76_13_06

> The application shall ensure that the makefile does not specify
> prerequisites for inference rules; no characters other than white
> space shall follow the <colon> in the first line, except when
> creating the empty rule, described below. Prerequisites are inferred,
> as described below.