-
Notifications
You must be signed in to change notification settings - Fork 45
/
Makefile
70 lines (46 loc) · 1.68 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
.PHONY: compile debug test quicktest clean all gen-errors gen-types _touch
PYTHON ?= python
ROOT = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
all: compile
clean:
rm -fr $(ROOT)/dist/
rm -fr $(ROOT)/doc/_build/
rm -fr $(ROOT)/edgedb/pgproto/*.c
rm -fr $(ROOT)/edgedb/pgproto/*.html
rm -fr $(ROOT)/edgedb/pgproto/codecs/*.html
rm -fr $(ROOT)/edgedb/protocol/*.c
rm -fr $(ROOT)/edgedb/protocol/*.html
rm -fr $(ROOT)/edgedb/protocol/*.so
rm -fr $(ROOT)/edgedb/datatypes/*.so
rm -fr $(ROOT)/edgedb/datatypes/datatypes.c
rm -fr $(ROOT)/build
rm -fr $(ROOT)/edgedb/protocol/codecs/*.html
find . -name '__pycache__' | xargs rm -rf
_touch:
rm -fr $(ROOT)/edgedb/datatypes/datatypes.c
rm -fr $(ROOT)/edgedb/protocol/protocol.c
find $(ROOT)/edgedb/protocol -name '*.pyx' | xargs touch
find $(ROOT)/edgedb/datatypes -name '*.pyx' | xargs touch
find $(ROOT)/edgedb/datatypes -name '*.c' | xargs touch
compile: _touch
$(PYTHON) setup.py build_ext --inplace
gen-errors:
edb gen-errors --import "$(echo "from edgedb.errors._base import *"; echo "from edgedb.errors.tags import *")" \
--extra-all "_base.__all__" --stdout --client > $(ROOT)/.errors
mv $(ROOT)/.errors $(ROOT)/edgedb/errors/__init__.py
$(PYTHON) tools/gen_init.py
gen-types:
edb gen-types --stdout > $(ROOT)/edgedb/protocol/codecs/edb_types.pxi
debug: _touch
EDGEDB_DEBUG=1 $(PYTHON) setup.py build_ext --inplace
test:
PYTHONASYNCIODEBUG=1 $(PYTHON) setup.py test
$(PYTHON) setup.py test
USE_UVLOOP=1 $(PYTHON) setup.py test
testinstalled:
cd /tmp && $(PYTHON) $(ROOT)/tests/__init__.py
quicktest:
$(PYTHON) setup.py test
htmldocs:
$(PYTHON) setup.py build_ext --inplace
$(MAKE) -C docs html SPHINXOPTS="-W -n"