-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (47 loc) · 1.66 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
.PHONY: default \
prepare \
build-rust \
build-linux \
build-windows \
build-osx-x86 \
build-osx-arm \
copy-so \
libpolymath_c_darwin_aarch64 \
libpolymath_c_darwin_x86_64 \
libpolymath_c_linux_x86_64 \
polymath_cli_win32_x86_64
default: prepare build-rust
prepare:
rustup target add x86_64-pc-windows-gnu
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
build-rust: build-linux build-windows build-osx-x86 build-osx-arm copy-so
build-linux:
cd polymath-c && cargo build --lib --release
build-windows:
cd polymath-c && cargo build --lib --target x86_64-pc-windows-gnu --release
build-osx-x86:
cd polymath-c && cargo build --lib --target x86_64-apple-darwin --release
build-osx-arm:
cd polymath-c && cargo build --lib --target aarch64-apple-darwin --release
copy-so: \
libpolymath_c_darwin_aarch64 \
libpolymath_c_darwin_x86_64 \
libpolymath_c_linux_x86_64 \
polymath_c_win32_x86_64
libpolymath_c_darwin_aarch64:
mkdir -p polymath-java/src/main/resources/darwin-aarch64
cp target/aarch64-apple-darwin/release/libpolymath_c.dylib \
polymath-java/src/main/resources/darwin-aarch64
libpolymath_c_darwin_x86_64:
mkdir -p polymath-java/src/main/resources/darwin-x86-64
cp target/x86_64-apple-darwin/release/libpolymath_c.dylib \
polymath-java/src/main/resources/darwin-x86-64
libpolymath_c_linux_x86_64:
mkdir -p polymath-java/src/main/resources/linux-x86-64
cp target/release/libpolymath_c.so \
polymath-java/src/main/resources/linux-x86-64
polymath_c_win32_x86_64:
mkdir -p polymath-java/src/main/resources/win32-x86-64
cp target/x86_64-pc-windows-gnu/release/polymath_c.dll \
polymath-java/src/main/resources/win32-x86-64