forked from nkmathew/yasi-sexp-indenter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
112 lines (90 loc) · 1.87 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
ifeq ($(OS),Windows_NT)
PYTHON?=python
else
PYTHON?=python3
endif
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
all: help
.PHONY : all
egg:
${PYTHON} setup.py sdist
.PHONY : egg
dist:
${PYTHON} setup.py sdist upload
.PHONY : dist
README.rst: README.md
pandoc --from markdown --to rst --output README.rst README.md
rst: README.rst
.PHONY : rst
htm: README.html
.PHONY : htm
html: README.html
.PHONY : html
README.html: README.rst
${PYTHON} rst2html.py -stg README.rst README.html
py-test:
@${PYTHON} tests/test_yasi.py
.PHONY : py-test
deps:
-${PYTHON} -m pip install -r $(ROOT_DIR)/requirements.txt
.PHONY : deps
new-test:
@newlisp tests/test-yasi-module.lsp
.PHONY : new-test
test: py-test new-test
.PHONY : test
tags: yasi.py
ctags yasi.py
fmt: yasi.py tests/test_yasi.py
autopep8 $^ \
--indent-size=4 \
--in-place \
--ignore=E221 \
--max-line-length 130
.PHONY : fmt
lint:
-pycodestyle yasi.py tests/test_yasi.py
@printf "\033[01;36m\n-------------------\n\n\033[0m"
-pylint yasi.py tests/test_yasi.py
@printf "\033[01;36m\n-------------------\n\n\033[0m"
flake8 yasi.py tests/test_yasi.py
.PHONY : lint
clean:
rm -rf README.html \
__pycache__ tags \
README.html \
README.rst \
*.pyc \
*.bak~ \
dist/* \
tests/cases/*.bak~
.PHONY : clean
install: html
${PYTHON} setup.py install
.PHONY : install
clean-dist:
rm -rf dist/*
.PHONY : clean-dist
upload-test: clean-dist egg
twine upload --repository testpypi dist/*
.PHONY : upload-test
upload: clean-dist egg
twine upload dist/*
.PHONY : upload
help:
@echo "Targets:"
@echo " -> clean"
@echo " -> clean-dist"
@echo " -> deps"
@echo " -> dist"
@echo " -> egg"
@echo " -> fmt"
@echo " -> htm(html)"
@echo " -> install"
@echo " -> lint"
@echo " -> rst"
@echo " -> tags"
@echo " -> test(new-test, py-test)"
@echo " -> upload"
@echo " -> upload-test"
.PHONY : help