-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
74 lines (56 loc) · 2.13 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
PACKAGE=pyrogg
PYTHON?=python
TESTFLAGS=
TESTOPTS=
SETUPFLAGS=$(shell "$(PYTHON)" -c 'import Cython.Compiler.Main' 2>/dev/null && echo "--recompile")
VERSION?=$(shell sed -ne 's|^__version__\s*=\s*"\([^"]*\)".*|\1|p' src/pyrogg.pyx)
MANYLINUX_IMAGE_X86_64=quay.io/pypa/manylinux1_x86_64
MANYLINUX_IMAGE_686=quay.io/pypa/manylinux1_i686
all: inplace
sdist:
$(PYTHON) setup.py $(SETUPFLAGS) sdist
# Build in-place
inplace:
$(PYTHON) setup.py $(SETUPFLAGS) build_ext -i
build:
$(PYTHON) setup.py $(SETUPFLAGS) build
test_build: build
$(PYTHON) test.py $(TESTFLAGS) $(TESTOPTS)
test_inplace: inplace
$(PYTHON) test.py $(TESTFLAGS) $(TESTOPTS)
bench_inplace: inplace
$(PYTHON) bench.py -i
ftest_build: build
$(PYTHON) test.py -f $(TESTFLAGS) $(TESTOPTS)
ftest_inplace: inplace
$(PYTHON) test.py -f $(TESTFLAGS) $(TESTOPTS)
html:
mkdir -p doc/html
$(PYTHON) doc/mkhtml.py doc/html . `cat version.txt`
# XXX What should the default be?
test: test_inplace
bench: bench_inplace
ftest: ftest_inplace
clean:
find . \( -name '*.o' -o -name '*.so' -o -name '*.py[cod]' -o -name '*.dll' \) -exec rm -f {} \;
rm -rf build
realclean: clean
find . -name '*.c' -exec rm -f {} \;
rm -f TAGS
$(PYTHON) setup.py clean -a
wheel_manylinux: wheel_manylinux64 wheel_manylinux32
wheel_manylinux32 wheel_manylinux64: dist/$(PACKAGE)-$(VERSION).tar.gz
echo "Building wheels for $(PACKAGE) $(VERSION)"
mkdir -p wheelhouse_$(subst wheel_,,$@)
time docker run --rm -t \
-v $(shell pwd):/io \
-e CFLAGS="-O3 -g1 -mtune=generic -pipe -fPIC -flto" \
-e LDFLAGS="$(LDFLAGS) -fPIC -flto" \
-e WHEELHOUSE=wheelhouse_$(subst wheel_,,$@) \
$(if $(patsubst %32,,$@),$(MANYLINUX_IMAGE_X86_64),$(MANYLINUX_IMAGE_686)) \
bash -c '/opt/python/cp27-cp27m/bin/python /io/buildlibs.py $${HOME}/INSTALL || exit 1; \
for PYBIN in /opt/python/*/bin; do \
$$PYBIN/python -V; \
{ PYROGG_STATIC_LIBS=$${HOME}/INSTALL/lib CFLAGS="-I$${HOME}/INSTALL/include $$CFLAGS" $$PYBIN/pip wheel -w /io/$$WHEELHOUSE /io/$< & } ; \
done; wait; \
for whl in /io/$$WHEELHOUSE/$(PACKAGE)-$(VERSION)-*-linux_*.whl; do auditwheel repair $$whl -w /io/$$WHEELHOUSE; done'