-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
49 lines (36 loc) · 906 Bytes
/
Makefile
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
40
41
42
43
44
45
46
47
48
49
# SPDX-FileCopyrightText: 2025 2024 Sebastian Andersson <[email protected]>
#
# SPDX-License-Identifier: GPL-3.0-or-later
.SILENT:
VENV:=venv
VENV_TIMESTAMP:=$(VENV)/.timestamp
PIP:=$(VENV)/bin/pip3
BLACK:=$(VENV)/bin/black
PYLINT:=$(VENV)/bin/pylint
REUSE:=$(VENV)/bin/reuse
SRC=$(wildcard *.py)
help:
@echo Available targets:
@echo fmt - formats the python files.
@echo lint - check the python files with pylint.
@echo clean - remove venv directory.
$(VENV_TIMESTAMP): requirements.txt
@echo Building $(VENV)
virtualenv -p python3 $(VENV)
$(PIP) install -r $<
touch $@
$(BLACK): $(VENV_TIMESTAMP)
$(PIP) install black
$(PYLINT): $(VENV_TIMESTAMP)
$(PIP) install pylint
$(REUSE): $(VENV_TIMESTAMP)
$(PIP) install reuse
fmt: $(BLACK)
$(BLACK) $(SRC)
lint: $(PYLINT)
$(PYLINT) $(SRC)
reuse: $(REUSE)
$(REUSE) lint
clean:
@rm -rf $(VENV) 2>/dev/null
.PHONY: clean fmt lint reuse