-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (54 loc) · 1.94 KB
/
Makefile
File metadata and controls
74 lines (54 loc) · 1.94 KB
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
ARCHS_IOS = x86_64-apple-ios aarch64-apple-ios aarch64-apple-ios-sim
ARCHS_ANDROID = i686-linux-android x86_64-linux-android aarch64-linux-android armv7-linux-androideabi
XCFRAMEWORK = CanvasNative.xcframework
RUST_LIB = canvasnative
all: GENERATE_HEADERS ios android
ios: $(XCFRAMEWORK)
android: GENERATE_ANDROID
ios-svg: GENERATE_IOS_SVG
android-svg: GENERATE_ANDROID_SVG
.PHONY: GENERATE_HEADERS
GENERATE_HEADERS:
./tools/scripts/build-headers.sh
# --- iOS builds ---
.PHONY: $(ARCHS_IOS)
$(ARCHS_IOS): %:
RUSTFLAGS="-Zlocation-detail=none -Zunstable-options -Cpanic=immediate-abort" \
cargo +nightly build -Z build-std='std,panic_abort' \
--target $@ --release -p canvas-ios
$(XCFRAMEWORK): $(ARCHS_IOS)
# --- Android builds ---
.PHONY: $(ARCHS_ANDROID)
$(ARCHS_ANDROID): %:
./tools/scripts/build-android.sh $@
.PHONY: GENERATE_ANDROID
GENERATE_ANDROID: $(ARCHS_ANDROID)
# --- iOS SVG builds ---
.PHONY: $(addsuffix _svg,$(ARCHS_IOS))
$(addsuffix _svg,$(ARCHS_IOS)): %_svg:
RUSTFLAGS="-Zlocation-detail=none -Zunstable-options -Cpanic=immediate-abort" \
cargo +nightly build -Z build-std='std,panic_abort' \
--target $* --release -p canvas-svg-ios
.PHONY: GENERATE_IOS_SVG
GENERATE_IOS_SVG: $(addsuffix _svg,$(ARCHS_IOS))
# --- Android SVG builds ---
.PHONY: $(addsuffix _svg,$(ARCHS_ANDROID))
$(addsuffix _svg,$(ARCHS_ANDROID)): %_svg:
./tools/scripts/build-svg-android.sh $* svg
.PHONY: GENERATE_ANDROID_SVG
GENERATE_ANDROID_SVG: $(addsuffix _svg,$(ARCHS_ANDROID))
# --- Debug targets ---
.PHONY: ios_debug
ios_debug: $(addsuffix _debug,$(ARCHS_IOS))
.PHONY: android_debug
android_debug: $(addsuffix _debug,$(ARCHS_ANDROID))
.PHONY: $(addsuffix _debug,$(ARCHS_IOS))
$(addsuffix _debug,$(ARCHS_IOS)): %_debug:
cargo +nightly build --target $* -p canvas-ios
.PHONY: $(addsuffix _debug,$(ARCHS_ANDROID))
$(addsuffix _debug,$(ARCHS_ANDROID)): %_debug:
./tools/scripts/build-android.sh $* debug
# --- Clean ---
.PHONY: clean
clean:
rm -rf target