-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
55 lines (45 loc) · 1.42 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
#
# This Makefile is only required for the PyO3 python library. It is not required for normal cargo builds.
#
# use Maturin from the docker image
maturin=docker run --rm -v $(PWD):/io ghcr.io/pyo3/maturin
# specify the python version to build for
PYTHON_VERSION=3.10
# specify the target platforms to build for
TARGETS=x86_64-unknown-linux-gnu
# x86_64-pc-windows-msvc
# x86_64-pc-windows-msvc \
# x86_64-pc-windows-gnu \
# i686-pc-windows-gnu \
# \
# aarch64-apple-darwin \
# x86_64-apple-darwin \
# \
# x86_64-unknown-linux-gnu \
# aarch64-unknown-linux-gnu \
# powerpc-unknown-linux-gnu \
# powerpc64-unknown-linux-gnu \
# \
# x86_64-linux-android \
# aarch64-linux-android \
# i686-linux-android \
# \
# s390x-unknown-linux-gnu \
# x86_64-sun-solaris \
# x86_64-unknown-freebsd \
# in make, iterate over all toolchains
toolchains:
for target in $(TARGETS); do \
rustup target add $$target; \
done
prereqs:
sudo apt install -y llvm
build:
for target in $(TARGETS); do \
$(maturin) build --release --target $$target -i python${PYTHON_VERSION}; \
done
setup:
python3 -m venv .venv
.venv/bin/pip install toml
@# python packaging is soo messy (doing this to avoid cross streams with poetry and maturin)
.venv/bin/python3 -c 'import toml; c = toml.load("pyproject.toml") ; print("\n".join(c["project"]["optional-dependencies"]["dev"]))' | .venv/bin/pip install -r /dev/stdin