diff options
author | 2023-06-21 02:00:21 -0300 | |
---|---|---|
committer | 2023-06-21 14:21:09 -0300 | |
commit | 9789c263a2bfc28aa2685f24d452ace4be150aa6 (patch) | |
tree | e8208431ad13c779b428eeae14a82d0d28e9c80e /src/bash_completion | |
parent | build: disable most built-in implicit make rules (diff) | |
download | firejail-9789c263a2bfc28aa2685f24d452ace4be150aa6.tar.gz firejail-9789c263a2bfc28aa2685f24d452ace4be150aa6.tar.zst firejail-9789c263a2bfc28aa2685f24d452ace4be150aa6.zip |
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/' '{}')\" >'{}'"
Diffstat (limited to 'src/bash_completion')
-rw-r--r-- | src/bash_completion/Makefile | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bash_completion/Makefile b/src/bash_completion/Makefile index 516805886..6d5c45532 100644 --- a/src/bash_completion/Makefile +++ b/src/bash_completion/Makefile | |||
@@ -1,4 +1,6 @@ | |||
1 | .SUFFIXES: | 1 | .SUFFIXES: |
2 | MAKEFLAGS += -r | ||
3 | |||
2 | ROOT = ../.. | 4 | ROOT = ../.. |
3 | -include $(ROOT)/config.mk | 5 | -include $(ROOT)/config.mk |
4 | 6 | ||