-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (29 loc) · 934 Bytes
/
Makefile
File metadata and controls
39 lines (29 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Makefile derived from https://web.archive.org/web/20240205205603/https://venthur.de/2021-03-31-python-makefiles.html
# Get the directory this Makefile is sitting in
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
CHECK_SCRIPTS := $(ROOT_DIR)/src/bin/sanitize $(ROOT_DIR)/test/test.sh
# system python interpreter. used only to create virtual environment
PY = python3
VENV = venv
BIN=$(ROOT_DIR)/$(VENV)/bin
all: bashate shellcheck test yamllint
$(VENV): requirements.txt
$(PY) -m venv $(VENV)
$(BIN)/pip install --upgrade -r requirements.txt
touch $(VENV)
.PHONY: bashate
bashate: $(VENV)
$(BIN)/bashate $(CHECK_SCRIPTS)
.PHONY: shellcheck
shellcheck: $(VENV)
$(BIN)/shellcheck $(CHECK_SCRIPTS)
.PHONY: test
test:
$(ROOT_DIR)/test/test.sh
.PHONY: yamllint
yamllint: $(VENV)
$(BIN)/yamllint .
clean:
rm -rf $(VENV)
find . -type f -name *.pyc -delete
find . -type d -name __pycache__ -delete