[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: Paul Smith
Subject: Re: MAKEFLAGS=-r
Date: Mon, 17 Jul 2023 11:46:33 -0400
User-agent: Evolution 3.48.3 (by Flathub.org)

On Mon, 2023-07-17 at 11:45 +0200, Bruno Haible wrote:
> Dmitry Goncharov wrote:
> > Once the makefile author knows the makefile does not need built-in
> > rules, they should add MAKEFLAGS=-r in the makefile and
> > this will do a good service to all their users.

I'm not sure I've followed the entire discussion yet, but FYI I do not
usually recommend this method of clearing the default rules.  There are
issues with modifying MAKEFLAGS, especially with some older versions of
GNU Make.  And also, in some older versions setting MAKEFLAGS in the
makefile doesn't actually take effect anyway: it only helps for sub-

My recommendation has been to disable the built-in rules directly, if
you don't need them.  For example you can use:


to disable most of the built in rules (this is a POSIX standard
facility so it's helpful even for other versions of make).

Unfortunately that doesn't fix all problems because GNU Make also has a
few built-in rules that are defined using pattern rules (because suffix
rules are not powerful enough).  So a full list of "turn it all off"
would be this:

  %:: %,v
  %:: RCS/%,v
  %:: RCS/%
  %:: s.%
  %:: SCCS/s.%

Hopefully these are just considered funnily-named targets and won't
hurt anything, when used in non-GNU Make versions of make.

I admit this is annoying since it's possible that the catalog of built-
in rules could change in the future.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]