-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
55 lines (45 loc) · 1.65 KB
/
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
50
51
52
53
54
55
# file: Makefile
# vim:fileencoding=utf-8:fdm=marker:ft=make
#
# NOTE: This Makefile is only intended for developers.
# It is only meant for UNIX-like operating systems.
# Most of the commands require extra software.
# Building the documentation requires a working LaTeX installation.
#
# Author: R.F. Smith <[email protected]>
# Created: 2018-01-21 22:44:51 +0100
# Last modified: 2023-11-13T10:33:43+0100
.POSIX:
.PHONY: clean check format test doc zip
.SUFFIXES:
PROJECT:=lamprop
TAGCOMMIT!=git rev-list --tags --max-count=1
TAG!=git describe --tags ${TAGCOMMIT}
# For a Python program, help is the default target.
help::
@echo "Command Meaning"
@echo "------- -------"
@sed -n -e '/##/s/:.*\#\#/\t/p' -e '/@sed/d' Makefile
clean:: ## remove all generated files.
rm -f lamprop lamprop-gui
rm -f backup-*.tar* ${PROJECT}-*.zip
find . -type f -name '*.pyc' -delete
find . -type d -name __pycache__ -delete
cd doc && make clean
check:: .IGNORE ## check all python files. (requires pylama)
pylama lp/*.py test/*.py console.py gui.py tools/*.py
tags:: ## regenerate tags file. (requires uctags)
uctags -R --languages=Python
format:: ## format the source. (requires black)
black lp/*.py test/*.py console.py gui.py tools/*.py
test:: ## run the built-in tests. (requires py.test)
py.test -v
doc:: ## build the documentation using LaTeX.
cd doc/; make
zip:: clean ## create a zip-file from the most recent tagged state of the repository.
cd doc && make clean
git checkout ${TAG}
cd .. && zip -r ${PROJECT}-${TAG}.zip ${PROJECT} \
-x '*/.git/*' '*/.pytest_cache/*' '*/__pycache__/*' '*/.cache/*'
git checkout main
mv ../${PROJECT}-${TAG}.zip .