From 9789c263a2bfc28aa2685f24d452ace4be150aa6 Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Wed, 21 Jun 2023 02:00:21 -0300 Subject: build: disable all built-in implicit make rules Use `make -r` to reduce unnecessary filesystem lookups. Overall, this appears to reduce the amount of implicit rule searches by ~93.3% (~97.5% compared to a8f01a383) for the default build and by ~83.3% (~99.3% compared to a8f01a383) for the "man" target (as an example): $ git show --pretty='%h %ai %s' -s a8f01a383 2023-06-20 05:26:23 +0000 Merge pull request #5859 from kmk3/build-remove-retpoline $ ./configure >/dev/null $ make clean >/dev/null && make --debug=i -j 4 | grep -F 'Trying implicit' | wc -l 6798 $ make clean >/dev/null && make --debug=i -j 4 man | grep -F 'Trying implicit' | wc -l 1085 # (in the previous commit) $ make clean >/dev/null && make --debug=i -j 4 | grep -F 'Trying implicit' | wc -l 2535 $ make clean >/dev/null && make --debug=i -j 4 man | grep -F 'Trying implicit' | wc -l 42 # (with this commit applied) $ make clean >/dev/null && make --debug=i -j 4 | grep -F 'Trying implicit' | wc -l 170 $ make clean >/dev/null && make --debug=i -j 4 man | grep -F 'Trying implicit' | wc -l 7 Environment: GNU make 4.4.1-2 on Artix Linux. Note: According to make(1p) in POSIX.1-2017, "If .SUFFIXES does not have any prerequisites, the list of known suffixes shall be cleared.", while "The result of setting MAKEFLAGS in the Makefile is unspecified." Commands used to search and replace: $ git ls-files -z -- '*Makefile*' | xargs -0 -I '{}' sh -c \ "printf '%s\n' \"\$(sed -E \ 's/^(.SUFFIXES:)/\1\nMAKEFLAGS += -r\n/' '{}')\" >'{}'" --- src/etc-cleanup/Makefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/etc-cleanup') diff --git a/src/etc-cleanup/Makefile b/src/etc-cleanup/Makefile index c8a12476e..7c542c4a9 100644 --- a/src/etc-cleanup/Makefile +++ b/src/etc-cleanup/Makefile @@ -1,4 +1,6 @@ .SUFFIXES: +MAKEFLAGS += -r + ROOT = ../.. -include $(ROOT)/config.mk -- cgit v1.2.3-54-g00ecf