From 93d623fdf9bee70bfae50168ac163825361f38e0 Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Fri, 23 Feb 2024 18:09:05 -0300 Subject: build: allow overriding certain tools Allow overriding the following tools at configure-time and build-time: * codespell * cppcheck * gawk * scan-build For example, instead of hardcoding `gawk`, enable overriding it at configure-time with: ./configure GAWK=/path/to/gawk To override it for a single `make` invocation: make GAWK=/path/to/gawk Also, add default values for the programs that are not found (rather than leaving the variables empty), to make error messages clearer when trying to run them: $ make CPPCHECK= cppcheck-old [...] force --error-exitcode=1 --enable=warning,performance . make: force: No such file or directory $ make CPPCHECK=cppcheck cppcheck-old [...] cppcheck --force --error-exitcode=1 --enable=warning,performance . make: cppcheck: No such file or directory --- src/bash_completion/Makefile | 2 +- src/man/Makefile | 2 +- src/zsh_completion/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/bash_completion/Makefile b/src/bash_completion/Makefile index 1df030da3..c7ef6afc6 100644 --- a/src/bash_completion/Makefile +++ b/src/bash_completion/Makefile @@ -6,7 +6,7 @@ ROOT = ../.. all: firejail.bash_completion firejail.bash_completion: firejail.bash_completion.in $(ROOT)/config.mk - gawk -f ../man/preproc.awk -- $(MANFLAGS) < $< > $@.tmp + $(GAWK) -f ../man/preproc.awk -- $(MANFLAGS) < $< > $@.tmp sed "s|_SYSCONFDIR_|$(sysconfdir)|" < $@.tmp > $@ rm $@.tmp diff --git a/src/man/Makefile b/src/man/Makefile index 526ed7fcb..1c1fd49a5 100644 --- a/src/man/Makefile +++ b/src/man/Makefile @@ -13,7 +13,7 @@ all: $(TARGET) # foo.1: foo.1.in $(MOD_DIR)/%: $(MOD_DIR)/%.in $(ROOT)/config.mk @printf 'Generating %s from %s\n' $@ $< - @gawk -f $(MOD_DIR)/preproc.awk -- $(MANFLAGS) <$< | \ + @$(GAWK) -f $(MOD_DIR)/preproc.awk -- $(MANFLAGS) <$< | \ $(MOD_DIR)/mkman.sh $(VERSION) >$@ # foo.1.gz: foo.1 diff --git a/src/zsh_completion/Makefile b/src/zsh_completion/Makefile index bf83877fb..e964d39ec 100644 --- a/src/zsh_completion/Makefile +++ b/src/zsh_completion/Makefile @@ -6,7 +6,7 @@ ROOT = ../.. all: _firejail _firejail: _firejail.in $(ROOT)/config.mk - gawk -f ../man/preproc.awk -- $(MANFLAGS) < $< > $@.tmp + $(GAWK) -f ../man/preproc.awk -- $(MANFLAGS) < $< > $@.tmp sed "s|_SYSCONFDIR_|$(sysconfdir)|" < $@.tmp > $@ rm $@.tmp -- cgit v1.2.3-54-g00ecf