From 8b5a28fa7893761c0d316314ff2dcb86c39ecff9 Mon Sep 17 00:00:00 2001 From: Dmitry Goncharov Date: Wed, 2 Jun 2021 08:04:09 -0400 Subject: [PATCH] depends: disable builtin rules and suffixes. When there is no rule to build a target in the makefile, make looks for a builtin rule. When --no-builtin-rules is specified make no longer performs this lookup. E.g. the following in an excerpt from make -d output. Here, make looks for a rule to build 'all'. Considering target file 'all'. File 'all' does not exist. Looking for an implicit rule for 'all'. Trying pattern rule with stem 'all'. Trying implicit prerequisite 'all.o'. Trying pattern rule with stem 'all'. Trying implicit prerequisite 'all.c'. Trying pattern rule with stem 'all'. Trying implicit prerequisite 'all.cc'. Trying pattern rule with stem 'all'. Trying implicit prerequisite 'all.C'. Trying pattern rule with stem 'all'. Trying implicit prerequisite 'all.cpp'. Trying pattern rule with stem 'all'. Trying implicit prerequisite 'all.p'. Trying pattern rule with stem 'all'. Trying implicit prerequisite 'all.f'. ... Many more lines like this are omitted. Because this build system does not use make builtin rules or suffixes, there is no benefit in having builtin rules enabled. There are 2 benefits in having builtin rules disabled. 1. Improves performance by eliminating redundant lookups. 2. Simplifies troubleshooting by reducing the output of make -d or make -p. --- depends/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/depends/Makefile b/depends/Makefile index ed54eac40a9..14069bc34e3 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -1,4 +1,6 @@ .NOTPARALLEL : +# Disable builtin rules and suffixes. +MAKEFLAGS += --no-builtin-rules # Pattern rule to print variables, e.g. make print-top_srcdir print-%: FORCE