summaryrefslogtreecommitdiff
path: root/GNUmakefile
diff options
context:
space:
mode:
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile19
1 files changed, 12 insertions, 7 deletions
diff --git a/GNUmakefile b/GNUmakefile
index dc94e46..518f8d6 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -87,15 +87,20 @@ sources_all := $(foreach v,$(filter sources_%,$(.VARIABLES)),$($v))
get_dscname = sed -n '1,3{ /^\#!/d; /^<!--$$/d; /-\*- .* -\*-/d; s,[/*\# ]*,,; s/ - .*//;p; q; }'
+build-aux/venv: build-aux/requirements.txt
+ python3 -m venv $@
+ $@/bin/pip install -r $<
+ touch --no-create $@
+
# `lint` ###########
lint:
$(MAKE) -k $(patsubst sources_%,lint/%,$(filter sources_%,$(.VARIABLES)))
lint/sh lint/bash: lint/%:
shellcheck $(sources_$*)
-lint/python3: lint/%:
- mypy --strict --scripts-are-modules $(sources_$*)
- black --check $(sources_$*)
- isort --check $(sources_$*)
+lint/python3: lint/%: build-aux/venv
+ ./build-aux/venv/bin/mypy --strict --scripts-are-modules $(sources_$*)
+ ./build-aux/venv/bin/black --check $(sources_$*)
+ ./build-aux/venv/bin/isort --check $(sources_$*)
lint/c: lint/%:
@for filename in $(filter %.h,$(sources_$*)); do \
dscname=$$($(get_dscname) $$filename); \
@@ -141,9 +146,9 @@ lint/all: lint/%:
# `format` #########
format:
$(MAKE) -k $(patsubst sources_%,format/%,$(filter-out sources_all,$(filter sources_%,$(.VARIABLES))))
-format/python3: format/%:
- black $(sources_$*)
- isort $(sources_$*)
+format/python3: format/%: ./build-aux/venv
+ ./build-aux/venv/bin/black $(sources_$*)
+ ./build-aux/venv/bin/isort $(sources_$*)
format/sh format/bash: format/%
@:
format/c: format/%: