diff options
author | Kelvin M. Klann <kmk3.code@protonmail.com> | 2024-02-23 18:09:05 -0300 |
---|---|---|
committer | Kelvin M. Klann <kmk3.code@protonmail.com> | 2024-02-24 18:50:43 -0300 |
commit | 93d623fdf9bee70bfae50168ac163825361f38e0 (patch) | |
tree | 4d944eee9eebdfc7c639577a685769c470a93a01 /Makefile | |
parent | profiles: drop paths already in wusc (#6218) (diff) | |
download | firejail-93d623fdf9bee70bfae50168ac163825361f38e0.tar.gz firejail-93d623fdf9bee70bfae50168ac163825361f38e0.tar.zst firejail-93d623fdf9bee70bfae50168ac163825361f38e0.zip |
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
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -2,6 +2,13 @@ | |||
2 | ROOT = . | 2 | ROOT = . |
3 | -include config.mk | 3 | -include config.mk |
4 | 4 | ||
5 | # Default programs | ||
6 | CC ?= cc | ||
7 | CODESPELL ?= codespell | ||
8 | CPPCHECK ?= cppcheck | ||
9 | GAWK ?= gawk | ||
10 | SCAN_BUILD ?= scan-build | ||
11 | |||
5 | ifneq ($(HAVE_MAN),no) | 12 | ifneq ($(HAVE_MAN),no) |
6 | MAN_TARGET = man | 13 | MAN_TARGET = man |
7 | endif | 14 | endif |
@@ -357,18 +364,18 @@ extras: all | |||
357 | 364 | ||
358 | .PHONY: cppcheck | 365 | .PHONY: cppcheck |
359 | cppcheck: clean | 366 | cppcheck: clean |
360 | cppcheck --force --error-exitcode=1 --enable=warning,performance . | 367 | $(CPPCHECK) --force --error-exitcode=1 --enable=warning,performance . |
361 | 368 | ||
362 | .PHONY: scan-build | 369 | .PHONY: scan-build |
363 | scan-build: clean | 370 | scan-build: clean |
364 | scan-build $(MAKE) | 371 | $(SCAN_BUILD) $(MAKE) |
365 | 372 | ||
366 | # TODO: Old codespell versions (such as v2.1.0 in CI) have issues with | 373 | # TODO: Old codespell versions (such as v2.1.0 in CI) have issues with |
367 | # contrib/syscalls.sh | 374 | # contrib/syscalls.sh |
368 | .PHONY: codespell | 375 | .PHONY: codespell |
369 | codespell: | 376 | codespell: |
370 | @printf 'Running %s...\n' $@ | 377 | @printf 'Running %s...\n' $@ |
371 | @codespell --ignore-regex 'Manuel|UE|als|chage|creat|doas|ether|isplay|readby|[Ss]hotcut' \ | 378 | @$(CODESPELL) --ignore-regex 'Manuel|UE|als|chage|creat|doas|ether|isplay|readby|[Ss]hotcut' \ |
372 | -S *.d,*.gz,*.o,*.so \ | 379 | -S *.d,*.gz,*.o,*.so \ |
373 | -S COPYING,m4 \ | 380 | -S COPYING,m4 \ |
374 | -S ./contrib/syscalls.sh \ | 381 | -S ./contrib/syscalls.sh \ |