-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
81 lines (64 loc) · 2.2 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
PYTHON=`which python`
DESTDIR=/
PROJECT=tron
BUILDIR=$(CURDIR)/debian/$PROJECT
VERSION=`$(PYTHON) setup.py --version`
DOT=dot -Tpng
SPHINXBUILD=sphinx-build
DOCS_DIR=docs
DOCS_BUILDDIR=docs/_build
DOCS_STATICSDIR=$(DOCS_DIR)/images
ALLSPHINXOPTS=-d $(DOCS_BUILDDIR)/doctrees $(SPHINXOPTS)
.PHONY : all source install clean tests docs
all:
@echo "make source - Create source package"
@echo "make build - Build from source"
@echo "make install - Install on local system"
@echo "make rpm - Generate a rpm package"
@echo "make deb - Generate a deb package"
@echo "make clean - Get rid of scratch and byte files"
source:
$(PYTHON) setup.py sdist $(COMPILE)
build:
$(PYTHON) setup.py build $(COMPILE)
install:
$(PYTHON) setup.py install --root $(DESTDIR) $(COMPILE)
rpm:
$(PYTHON) setup.py bdist_rpm --post-install=rpm/postinstall --pre-uninstall=rpm/preuninstall
deb: man
# build the source package in the parent directory
# then rename it to project_version.orig.tar.gz
$(PYTHON) setup.py sdist $(COMPILE) --dist-dir=../
rename -f 's/$(PROJECT)-(.*)\.tar\.gz/$(PROJECT)_$$1\.orig\.tar\.gz/' ../*
# build the package
dpkg-buildpackage -i -I -rfakeroot -uc -us
clean:
$(PYTHON) setup.py clean
rm -rf build/ MANIFEST
find . -name '*.pyc' -delete
find . -name "._*" -delete
rm -rf $(DOCS_BUILDDIR)/*
rm -rf $(DOCS_STATICSDIR)/*
fakeroot $(MAKE) -f $(CURDIR)/debian/rules clean
coffee:
mkdir -p tronweb/js/cs
coffee -o tronweb/js/cs/ -c tronweb/coffee/
# TODO: add less target, and web target
docs:
PYTHONPATH=. $(PYTHON) tools/state_diagram.py
mkdir -p $(DOCS_STATICSDIR)
$(DOT) -o$(DOCS_STATICSDIR)/action.png action.dot
$(DOT) -o$(DOCS_STATICSDIR)/service_instance.png service_instance.dot
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(DOCS_DIR) $(DOCS_BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(DOCS_BUILDDIR)/html."
doc: docs
man:
which $(SPHINXBUILD) >/dev/null && $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(DOCS_DIR) $(DOCS_DIR)/man || true
@echo
@echo "Build finished. The manual pages are in $(DOCS_BUILDDIR)/man."
tests:
PYTHONPATH=.:bin testify -x sandbox -x mongodb -x integration tests
test: tests
test_all:
PYTHONPATH=.:bin testify tests --summary