summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GNUmakefile40
1 files changed, 21 insertions, 19 deletions
diff --git a/GNUmakefile b/GNUmakefile
index f6ff6c3..bfc2c5a 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -109,13 +109,22 @@ build-aux/venv: build-aux/requirements.txt
$@/bin/pip install -r $<
touch --no-create $@
-# `lint` ###########
+# `lint` ###############################
+# generic ##########
lint:
$(MAKE) -k INNER=t $(patsubst sources_%,lint/%,$(filter sources_%,$(.VARIABLES)))
# Only lint binaries if the build scripts pass lint.
$(MAKE) INNER=t lint/bin
lint/bin: build build-aux/lint-bin
./build-aux/lint-bin $(foreach t,$(build_types),build/rp2040-$t/cmd/sbc_harness/sbc_harness.elf)
+lint/all: lint/%: build-aux/lint-generic build-aux/get-dscname
+ ./build-aux/lint-generic '%s\n' $(sources_$*)
+lint/unknown: lint/%: build-aux/lint-unknown
+ ./build-aux/lint-unknown $(sources_$*)
+.PHONY: lint lint/%
+# specific #########
+lint/c: lint/%: build-aux/lint-h build-aux/get-dscname
+ ./build-aux/lint-h $(filter %.h,$(sources_$*))
lint/sh lint/bash: lint/%:
shellcheck $(sources_$*)
lint/python3: lint/%: build-aux/venv
@@ -125,28 +134,21 @@ lint/python3: lint/%: build-aux/venv
./build-aux/venv/bin/pylint $(sources_$*)
! grep -nh 'SPECIAL$$' -- lib9p/proto.gen lib9p/protogen/*.py
./build-aux/venv/bin/pytest $(foreach f,$(sources_python3),$(if $(filter test_%.py,$(notdir $f)),$f))
-lint/c: lint/%: build-aux/lint-h build-aux/get-dscname
- ./build-aux/lint-h $(filter %.h,$(sources_$*))
lint/make lint/cmake lint/gitignore lint/ini lint/9p lint/markdown lint/pip lint/man-cat: lint/%:
- @:
-lint/unknown: lint/%: build-aux/lint-unknown
- ./build-aux/lint-unknown $(sources_$*)
-lint/all: lint/%: build-aux/lint-generic build-aux/get-dscname
- ./build-aux/lint-generic '%s\n' $(sources_$*)
-.PHONY: lint lint/%
+ @: TODO: Write/adopt linters for these file types
-# `format` #########
+# `format` #############################
+# generic ##########
format:
- $(MAKE) -k INNER=t $(patsubst sources_%,format/%,$(filter-out sources_all,$(filter sources_%,$(.VARIABLES))))
+ $(MAKE) -k INNER=t $(patsubst sources_%,format/%,$(filter-out sources_all sources_unknown,$(filter sources_%,$(.VARIABLES))))
+.PHONY: format format/%
+# specific #########
+format/c: format/%:
+ @: TODO: Adopt a C code-formatter
+format/sh format/bash: format/%:
+ @: TODO: Adopt shfmt
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/%:
- @: TODO: Adopt a C code-formatter
format/make format/cmake format/gitignore format/ini format/9p format/markdown format/pip format/man-cat: format/%:
- @:
-format/unknown: format/%:
- @:
-.PHONY: format format/%
+ @: TODO: Write/adopt formatters for these file types