-
Notifications
You must be signed in to change notification settings - Fork 29
/
ffi.mk
81 lines (69 loc) · 2.31 KB
/
ffi.mk
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
MANYLINUX_PREFIX=pyroscope/rust_builder
MANYLINUX_VERSION=4
BUILD_ARCH_AMD=manylinux2014_x86_64
BUILD_ARCH_ARM=manylinux2014_aarch64
.phony: pyroscope_ffi/clean
pyroscope_ffi/clean:
cargo clean
make -C pyroscope_ffi/python/ clean
make -C pyroscope_ffi/ruby/ clean
.phony: wheel/linux/amd64
wheel/linux/amd64: pyroscope_ffi/clean
docker buildx build \
--build-arg=BASE=$(MANYLINUX_PREFIX)_$(BUILD_ARCH_AMD):$(MANYLINUX_VERSION) \
--platform=linux/amd64 \
--output=pyroscope_ffi/python \
-f docker/wheel.Dockerfile \
.
.phony: wheel/linux/arm64
wheel/linux/arm64: pyroscope_ffi/clean
docker buildx build \
--build-arg=BASE=$(MANYLINUX_PREFIX)_$(BUILD_ARCH_ARM):$(MANYLINUX_VERSION) \
--platform=linux/arm64 \
--output=pyroscope_ffi/python \
-f docker/wheel.Dockerfile \
.
.phony: wheel/mac/amd64
wheel/mac/amd64:
cd pyroscope_ffi/python && \
pip install wheel && \
CARGO_BUILD_TARGET=x86_64-apple-darwin \
python setup.py bdist_wheel -p macosx-11_0_x86_64
.phony: wheel/mac/arm64
wheel/mac/arm64:
cd pyroscope_ffi/python && \
pip install wheel && \
CARGO_BUILD_TARGET=aarch64-apple-darwin \
python setup.py bdist_wheel -p macosx-11_0_arm64
.phony: gem/linux/amd64
gem/linux/amd64: pyroscope_ffi/clean
docker buildx build \
--build-arg=BASE=$(MANYLINUX_PREFIX)_$(BUILD_ARCH_AMD):$(MANYLINUX_VERSION) \
--build-arg="TARGET_TASK=x86_64_linux:gem" \
--output=pyroscope_ffi/ruby \
--platform=linux/amd64 \
-f docker/gem.Dockerfile \
.
.phony: gem/linux/arm64
gem/linux/arm64: pyroscope_ffi/clean
docker buildx build \
--build-arg=BASE=$(MANYLINUX_PREFIX)_$(BUILD_ARCH_ARM):$(MANYLINUX_VERSION) \
--build-arg="TARGET_TASK=aarch64_linux:gem" \
--output=pyroscope_ffi/ruby \
--platform=linux/arm64 \
-f docker/gem.Dockerfile \
.
.phony: gem/mac/amd64
gem/mac/amd64: pyroscope_ffi/clean
cd pyroscope_ffi/ruby && \
bundle && \
RUST_TARGET=x86_64-apple-darwin rake rbspy_install && \
RUST_TARGET=x86_64-apple-darwin rake thread_id_install && \
RUST_TARGET=x86_64-apple-darwin rake x86_64_darwin:gem
.phony: gem/mac/arm64
gem/mac/arm64: pyroscope_ffi/clean
cd pyroscope_ffi/ruby && \
bundle && \
RUST_TARGET=aarch64-apple-darwin rake rbspy_install && \
RUST_TARGET=aarch64-apple-darwin rake thread_id_install && \
RUST_TARGET=aarch64-apple-darwin rake arm64_darwin:gem