-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
199 lines (156 loc) · 5.28 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
#Python setup section
#This help message was taken from https://gist.github.com/rcmachado/af3db315e31383502660
## Show this help.
help:
@printf "Available targets\n\n"
@awk '/^[a-zA-Z\-\_0-9]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf "%-20s %s\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
#End python setup section
#Begin C section
## Initialize submodules
submodules:
@git submodule update --init --recursive
build:
@mkdir -p build
#End C section
#Begin Javascript section
jsver = $(shell node -p "require('./package.json').version")
## Install Javascript dependencies, preferring to use yarn, but using npm if it must
jsdeps:
@cd js2p; $(MAKE) jsdeps
## Copying documentation from C-like language into the proper Restructred Text files
jsdocs:
@echo "Copying documentation comments..."
@node docs/docs_walker.js
## Run Javascript test code
jstest:
@cd js2p; $(MAKE) jstest
## Run Javascript tests AND upload results to codecov (testing services only)
js_codecov:
@cd js2p; $(MAKE) js_codecov
## Package Javascript code into browser bundles
browser: build
@cd js2p; $(MAKE) browser
@cp -fur -t build js2p/build/*
## Package Javascript code into browser bundles and minify them
browser-min: build
@cd js2p; $(MAKE) browser-min
@cp -fur -t build js2p/build/*
## Transpile Javascript code into a non ES6 format, for older browsers or Node.js v4
js-compat: build
@cd js2p; $(MAKE) js-compat
@cp -fur -t build js2p/build/*
## Transpile Javascript code into a non ES6 format, for older browsers or Node.js v4 AND test this code
js_compat_test: build
@cd js2p; $(MAKE) js_compat_test
@cp -fur -t build js2p/build/*
## Transpile Javascript code into a non ES6 format, for older browsers or Node.js v4 AND test this code AND upload it to codecov (testing services only)
js_compat_codecov: build
@cd js2p; $(MAKE) js_compat_codecov
@cp -fur -t build js2p/build/*
## Transpile Javascript code into a non ES6 format, for older browsers or Node.js v4 AND package it into browser bundles
browser-compat: build
@cd js2p; $(MAKE) browser-compat
@cp -fur -t build js2p/build/*
## Transpile Javascript code into a non ES6 format, for older browsers or Node.js v4 AND package it into browser bundles, then minify it
browser-compat-min: build
@cd js2p; $(MAKE) browser-compat-min
@cp -fur -t build js2p/build/*
## Alias for the above
browser-min-compat: browser-compat-min
#End Javascript section
#Begin Python section
## Build python-only code for whatever your default system python is
python: build
@cd py2p; $(MAKE) python
@cp -fur -t build py2p/build/*
## Build python-only code for whatever your system python3 version is
python3: build
@cd py2p; $(MAKE) python3
@cp -fur -t build py2p/build/*
## Build python-only code for whatever your system python2 version is
python2: build
@cd py2p; $(MAKE) python2
@cp -fur -t build py2p/build/*
## Build python-only code for whatever your system pypy version is
pypy: build
@cd py2p; $(MAKE) pypy
@cp -fur -t build py2p/build/*
cpython: build
@cd py2p; $(MAKE) cpython
@cp -fur -t build py2p/build/*
## Build binary and python code for whatever your system python3 version is
cpython3: build
@cd py2p; $(MAKE) cpython3
@cp -fur -t build py2p/build/*
## Build binary and python code for whatever your system python2 version is
cpython2: build
@cd py2p; $(MAKE) cpython2
@cp -fur -t build py2p/build/*
## Install python test dependencies
pytestdeps:
@cd py2p; $(MAKE) pytestdeps
## Install python2 test dependencies
py2testdeps:
@cd py2p; $(MAKE) py2testdeps
## Install python3 test dependencies
py3testdeps:
@cd py2p; $(MAKE) py3testdeps
## Run python tests
pytest:
@cd py2p; $(MAKE) pytest
## Run python2 tests
py2test:
@cd py2p; $(MAKE) py2test
## Run python3 tests
py3test:
@cd py2p; $(MAKE) py3test
## Run cpython tests
cpytest: build
@cd py2p; $(MAKE) cpytest
@cp -fur -t build py2p/build/*
## Run cpython2 tests
cpy2test: build
@cd py2p; $(MAKE) cpy2test
@cp -fur -t build py2p/build/*
## Run cpython3 tests
cpy3test: build
@cd py2p; $(MAKE) cpy3test
@cp -fur -t build py2p/build/*
## Format the python code in place with YAPF
pyformat:
@cd py2p; $(MAKE) pyformat
## Run mypy tests
mypy:
@cd py2p; $(MAKE) mypy
## Build html documentation
html: jsdocs submodules
@python $(docs_deps)
@cd docs; $(MAKE) clean html
#End Python section
#Begin General section
## Clean up local folders, including Javascript depenedencies
clean:
@rm -rf .cache build docs/py2p
@find docs/c ! -name 'tutorial.rst' ! -wholename '*/tutorial/*' -type f -exec rm -f {} +
@find docs/cpp ! -name 'tutorial.rst' ! -wholename '*/tutorial/*' -type f -exec rm -f {} +
@find docs/java ! -name 'tutorial.rst' ! -wholename '*/tutorial/*' -type f -exec rm -f {} +
@find docs/javascript ! -name 'tutorial.rst' ! -wholename '*/tutorial/*' -type f -exec rm -f {} +
@cd docs; $(MAKE) clean
@cd py2p; $(MAKE) clean
@cd js2p; $(MAKE) clean
## Run all python-related build recipes
py_all:
@cd py2p; $(MAKE) all
## Run all Javascript-related build recipes
js_all:
@cd js2p; $(MAKE) all
## Run all test-related recipes
test_all: LICENSE clean jstest js_compat_test mypy pytest cpy2test cpy3test