forked from crs4/pydoop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
88 lines (68 loc) · 2.3 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
TEMPDIR := $(shell mktemp -u)
GIT_COMMIT_FN = .git_commit
WHEEL_DIR=./dist
PY_V := $(shell python -c 'import sys; print "%d.%d" % sys.version_info[:2]')
TARGETS=all build wheel install install_user install_wheel install_wheel_user\
docs docs_py docs_view \
clean distclean uninstall_user logo favicon
.PHONY: $(TARGETS)
all:
@echo "Try one of: ${TARGETS}"
install_user: build
python setup.py install --user
install: build
python setup.py install
build:
python setup.py build
wheel:
python setup.py bdist_wheel --dist-dir=${WHEEL_DIR}
install_wheel: wheel
pip install --use-wheel --no-index --pre --find-links=${WHEEL_DIR} pydoop
install_wheel_user: wheel
pip install --use-wheel --no-index --pre --find-links=${WHEEL_DIR} pydoop --user
logo: docs/_static/logo.png
favicon: docs/_static/favicon.ico
docs/_static/logo.png: logo/logo.svg
# direct conversion to final size with inkscape does not look good
inkscape -z -D -f $< -e logo/logo.png -w 800 # -b '#ffffff'
convert -resize 200x logo/logo.png $@
rm -f logo/logo.png
docs/_static/favicon.ico: logo/favicon.svg
inkscape -z -D -f $< -e favicon-256.png -w 256 -h 256
for i in 16 32 64 128; do \
convert favicon-256.png -resize $${i}x$${i} favicon-$${i}.png; \
done
convert favicon-16.png favicon-32.png favicon-64.png favicon-128.png $@
rm -f favicon-*.png
# pydoop must be installed for sphinx autodoc to work
docs: install_user logo favicon
make -C docs html
docs_py: install_user_py logo favicon
make -C docs html
docs_view: docs
yelp docs/_build/html/index.html &
docs_update: docs
mkdir -p $(TEMPDIR)
mv docs/_build/html/* $(TEMPDIR)/
git stash
git checkout gh-pages
rsync -avz --delete --exclude '.??*' $(TEMPDIR)/ ./
rm -rf $(TEMPDIR)
dist: docs
./dev_tools/git_export -o $(TEMPDIR)
git rev-parse HEAD >$(TEMPDIR)/$(GIT_COMMIT_FN)
rm -rf $(TEMPDIR)/docs/*
mv docs/_build/html $(TEMPDIR)/docs/
cd $(TEMPDIR) && python setup.py sdist
mv -i $(TEMPDIR)/dist/pydoop-*.tar.gz .
rm -rf $(TEMPDIR)
clean:
python setup.py clean --all
rm -rf pydoop.egg-
rm -f docs/_static/logo.png docs/_static/favicon.ico
make -C docs clean
make -C examples clean
find . -regex '.*\(\.pyc\|\.pyo\|~\|\.so\|\.jar\|\.class\)' -exec rm -fv {} \;
uninstall_user:
rm -rf ~/.local/lib/python$(PY_V)/site-packages/pydoop*
rm -f ~/.local/bin/pydoop