-
Notifications
You must be signed in to change notification settings - Fork 127
/
Copy pathMakefile
47 lines (35 loc) · 1.14 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
.SUFFIXES:
.PHONY: test test_unicode test_bytes build build_unicode build_bytes clean valgrind benchmark
DEPS=src/*.c \
src/*.h \
setup.py \
tests/*.py
build: build_unicode
build_unicode: $(DEPS) venv/bin/activate
@rm -rf dist build *.so
AHOCORASICK_UNICODE=yes venv/bin/pip install -e .
build_bytes: $(DEPS) venv/bin/activate
@rm -rf dist build *.so
AHOCORASICK_BYTES=yes venv/bin/pip install -e .
test: test_unicode
test_unicode: $(DEPS) build_unicode
@rm -rf dist build *.so
AHOCORASICK_UNICODE=yes venv/bin/pip install -e .[testing]
venv/bin/pytest -vvs
test_bytes: $(DEPS) build_bytes
@rm -rf dist build *.so
AHOCORASICK_BYTES=yes venv/bin/pip install -e .[testing]
venv/bin/pytest -vvs
venv/virtualenv.pyz:
@mkdir -p venv
@curl -o venv/virtualenv.pyz https://bootstrap.pypa.io/virtualenv/virtualenv.pyz
venv/bin/activate: venv/virtualenv.pyz
python3 venv/virtualenv.pyz venv
benchmark: etc/benchmarks/benchmark.py build
python3 $^
valgrind:
python -c "import sys;print(sys.version)"
valgrind --leak-check=full --track-origins=yes --log-file=valgrind.log venv/bin/pytest -vvs
clean:
rm -f stamp/*
rm -rf dist build venv