| 1 |
# |
| 2 |
# Standard Makefile supports targets build, install and clean + static |
| 3 |
# code checking. make install respects DESTDIR, build and install respects |
| 4 |
# V=0 and V=1 |
| 5 |
PYLINT = pylint-3 |
| 6 |
|
| 7 |
ifeq ($(DESTDIR),) |
| 8 |
DESTDIR = $(CURDIR)/install |
| 9 |
endif |
| 10 |
|
| 11 |
VERBOSE = $(or $(V),0) |
| 12 |
ifeq ($(VERBOSE), 0) |
| 13 |
QUIET_OPT = --quiet |
| 14 |
endif |
| 15 |
|
| 16 |
PYTHON_SRC = plugins lib/ddupdate setup.py ddupdate ddupdate-config |
| 17 |
|
| 18 |
# vim-compatible error reporting: |
| 19 |
pylint_template = {path}:{line}: [{msg_id}({symbol}), {obj}] {msg} |
| 20 |
|
| 21 |
|
| 22 |
all: build |
| 23 |
|
| 24 |
build: |
| 25 |
python3 setup.py $(QUIET_OPT) build |
| 26 |
|
| 27 |
install: .phony |
| 28 |
python3 setup.py $(QUIET_OPT) install --root=$(DESTDIR) |
| 29 |
|
| 30 |
clean: .phony |
| 31 |
python3 setup.py clean |
| 32 |
|
| 33 |
pylint: $(PYTHON_SRC) |
| 34 |
-PYTHONPATH=$(CURDIR)/lib $(PYLINT) \ |
| 35 |
--rcfile=pylint.conf \ |
| 36 |
--msg-template='$(pylint_template)' \ |
| 37 |
$? |
| 38 |
|
| 39 |
pydocstyle: $(PYTHON_SRC) |
| 40 |
pydocstyle $? |
| 41 |
|
| 42 |
pycodestyle: $(PYTHON_SRC) |
| 43 |
-pycodestyle $? |
| 44 |
|
| 45 |
.phony: |