Skip to content

Commit cab6811

Browse files
committed
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 a8f01a3) for the default build and by ~83.3% (~99.3% compared to a8f01a3) for the "man" target (as an example): $ git show --pretty='%h %ai %s' -s a8f01a3 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) $ ./configure >/dev/null $ 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) $ ./configure >/dev/null $ 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/' '{}')\" >'{}'"
1 parent d4be8e5 commit cab6811

File tree

30 files changed

+60
-0
lines changed

30 files changed

+60
-0
lines changed

Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = .
35
-include config.mk
46

src/bash_completion/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/etc-cleanup/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/fbuilder/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/fcopy/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/fids/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/firecfg/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/firejail/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/firemon/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/fldd/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/fnet/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/fnetfilter/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/fnettrace-dns/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/fnettrace-icmp/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/fnettrace-sni/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/fnettrace/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/fsec-optimize/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/fsec-print/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/fseccomp/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/ftee/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/fzenity/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/jailcheck/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/lib/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/libpostexecseccomp/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/libtrace/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/libtracelog/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/man/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/profstats/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

src/zsh_completion/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ../..
35
-include $(ROOT)/config.mk
46

test/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.SUFFIXES:
2+
MAKEFLAGS += -r
3+
24
ROOT = ..
35
-include $(ROOT)/config.mk
46

0 commit comments

Comments
 (0)