-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
107 lines (86 loc) · 4.02 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
none:
echo "No default make target."
mathjax:
test "!" -e external/mathjax && mkdir -p external/mathjax && cd external/mathjax && npm install mathjax@3
reveal:
test "!" -e external/reveal.js && cd external && git clone https://github.com/hakimel/reveal.js.git && cd reveal.js && npm install
(cd external/reveal.js; patch -p0 < ../patches/reveal_videobg.patch)
(cd external/reveal.js; patch -p0 < ../patches/reveal_hash.patch)
(cd external/reveal.js; patch -p0 < ../patches/reveal_dist.patch)
reveal_light:
test "!" -e external/reveal.js && mkdir -p external && cd external && curl -L https://github.com/hakimel/reveal.js/archive/master.zip -o master.zip && unzip master.zip && rm -f master.zip && mv reveal.js-master reveal.js
(cd external/reveal.js; patch -p0 < ../patches/reveal_videobg.patch)
(cd external/reveal.js; patch -p0 < ../patches/reveal_hash.patch)
(cd external/reveal.js; patch -p0 < ../patches/reveal_dist.patch)
rstslide-light:
echo "Not implementated yet"
rstslide-full:
if [ ! -e "resources/mini-mathjax/README.md" ]; then cd resources; git clone "https://github.com/electricbookworks/mini-mathjax"; fi
if [ ! -e "resources/reveal.js/README.md" ]; then cd resources; git clone "https://github.com/hakimel/reveal.js.git"; fi
build:
mkdir -p build
test -e "resources/mini-mathjax/README.md" || exit 1
( if [ ! -e resources/build/mathjax ]; then \
mkdir -p build/mathjax; \
cp -rp resources/mini-mathjax/build/extensions build/resources/mathjax/.; \
cp -rp resources/mini-mathjax/build/jax build/resources/mathjax/.; \
cp -rp resources/mini-mathjax/build/MathJax.js build/resources/mathjax/.; \
cp -rp resources/mini-mathjax/build/LICENSE build/resources/mathjax/.; \
fi \
)
test -e "resources/reveal.js/README.md" || exit 1
( if [ ! -e resources/build/reveal.js ]; then \
cp -rp reveal.js build/resources/reveal.js; \
fi \
)
( if [ ! -e build/resources/reveal-plugins ]; then \
cp -rp resources/reveal-plugins build/resources/reveal-plugins; \
fi \
)
clean:
rm -rf build
autopep8:
autopep8 --ignore=E501,E401,E402,W391,E265,E266,E226 --aggressive --in-place -r src/
tests: unittests2 unittests3
pytests: pytest2 pytest3
unittests:
(cd tests; TEST_EXPECT_PYVER=ignore python all.py)
unittests2: link_python2
echo "Running unittests with Python 2"
# Avoid mkdir -p in case this is run not in the right directory.
(cd tests; TEST_EXPECT_PYVER=2 PATH="$$(pwd -P)/python_versions/ver2:$$PATH" python all.py)
unittests3: link_python3
echo "Running unittests with Python 3"
(cd tests; TEST_EXPECT_PYVER=3 PATH="$$(pwd -P)/python_versions/ver3:$$PATH" python all.py)
pytest:
(cd tests; TEST_EXPECT_PYVER=ignore py.test)
pytest2: link_python2
echo "Running pytest with Python 2"
(cd tests; TEST_EXPECT_PYVER=2 PATH="$$(pwd -P)/python_versions/ver2:$$PATH" py.test)
pytest3: link_python3
echo "Running pytest with Python 3"
(cd tests; TEST_EXPECT_PYVER=3 PATH="$$(pwd -P)/python_versions/ver3:$$PATH" py.test-3)
link_python2:
if [ ! -e tests/python_versions ]; then mkdir tests/python_versions; fi
if [ ! -e tests/python_versions/ver2 ]; then mkdir tests/python_versions/ver2; fi
if [ ! -e tests/python_versions/ver2/python ]; then ln -sf /usr/bin/python2 tests/python_versions/ver2/python; fi
link_python3:
if [ ! -e tests/python_versions ]; then mkdir tests/python_versions; fi
if [ ! -e tests/python_versions/ver3 ]; then mkdir tests/python_versions/ver3; fi
if [ ! -e tests/python_versions/ver3/python ]; then ln -sf /usr/bin/python3 tests/python_versions/ver3/python; fi
relink_python:
rm -f tests/python_versions/ver2/python
rmdir tests/python_versions/ver2
rm -f tests/python_versions/ver3/python
rmdir tests/python_versions/ver3
release:
( \
echo "Present release: $$(git describe --always)"; \
echo "Enter new tag:"; \
read tag; \
echo "$$tag" | awk '{printf("__version__ = '"'%s'"'\n",$$0)}' > rstslide/src/rstslide/_version.py; \
git add rstslide/src/rstslide/_version.py; \
git commit -m "Release $$tag"; \
git tag -s "$$tag" -m "Release $$tag"; \
git push -u origin "$$tag"; \
)