This repository has been archived by the owner on Nov 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Makefile
68 lines (50 loc) · 1.93 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
PYTEST = py.test
TEST_BASE_DIR = test
UNIT_TEST_DIR = $(TEST_BASE_DIR)/unit
SPHINX_DIR = doc/sphinx
SPHINX_BUILD_DIR = $(SPHINX_DIR)/build
SPHINX_TARGET = html
SPHINX_TARGET_DIR = $(SPHINX_BUILD_DIR)/$(SPHINX_TARGET)
SPHINXOPTS = -a
PORT = 8000
MESHES_DIR = demo/meshes
GIT_REV = $(shell git rev-parse --verify --short HEAD)
all: ext
.PHONY : help test lint unit doc update_docs ext ext_clean meshes
help:
@echo "make COMMAND with COMMAND one of:"
@echo " test : run lint and unit tests"
@echo " lint : run flake8 code linter"
@echo " unit : run unit tests"
@echo " unit_BACKEND : run unit tests for BACKEND"
@echo " doc : build sphinx documentation"
@echo " serve : launch local web server to serve up documentation"
@echo " update_docs : build sphinx documentation and push to GitHub"
@echo " ext : rebuild Cython extension"
@echo " ext_clean : delete generated extension"
@echo " meshes : download demo meshes"
@echo
@echo "Available OpenCL contexts: $(OPENCL_CTXS)"
test: lint unit
lint:
@flake8
unit:
cd $(TEST_BASE_DIR); $(PYTEST) unit
doc:
make -C $(SPHINX_DIR) $(SPHINX_TARGET) SPHINXOPTS=$(SPHINXOPTS)
serve:
make -C $(SPHINX_DIR) livehtml
update_docs:
if [ ! -d $(SPHINX_TARGET_DIR)/.git ]; then \
mkdir -p $(SPHINX_BUILD_DIR); \
cd $(SPHINX_BUILD_DIR); git clone `git config --get remote.origin.url` $(SPHINX_TARGET); \
fi
cd $(SPHINX_TARGET_DIR); git fetch -p; git checkout -f gh-pages; git reset --hard origin/gh-pages
make -C $(SPHINX_DIR) $(SPHINX_TARGET) SPHINXOPTS=$(SPHINXOPTS)
cd $(SPHINX_TARGET_DIR); git add .; git commit -am "Update documentation to revision $(GIT_REV)"; git push origin gh-pages
ext: ext_clean
python setup.py build_ext -i
ext_clean:
rm -rf build pyop2/compute_ind.c pyop2/compute_ind.so pyop2/sparsity.c pyop2/sparsity.so
meshes:
make -C $(MESHES_DIR) meshes