-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (48 loc) · 1.51 KB
/
Makefile
File metadata and controls
59 lines (48 loc) · 1.51 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
NDK_ROOT ?= /opt/android-ndk-r25b
NDK_BIN := $(NDK_ROOT)/toolchains/llvm/prebuilt/linux-x86_64/bin
CARGO ?= $(shell command -v cargo 2>/dev/null || echo /home/president/.cargo/bin/cargo)
MODULE := module
TARGETS := aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android
ABI_aarch64-linux-android := arm64-v8a
ABI_armv7-linux-androideabi := armeabi-v7a
ABI_x86_64-linux-android := x86_64
ABI_i686-linux-android := x86
export PATH := $(NDK_BIN):$(PATH)
.PHONY: all debug release clean install-debug install-release check
all: debug release
debug:
@for t in $(TARGETS); do \
echo "==> [debug] $$t"; \
$(CARGO) build --target $$t 2>&1; \
done
@echo "==> debug build complete (symbols preserved, no strip)"
release:
@for t in $(TARGETS); do \
echo "==> [release] $$t"; \
$(CARGO) build --release --target $$t 2>&1; \
done
@echo "==> release build complete (LTO + stripped)"
install-debug:
@for t in $(TARGETS); do \
abi=$${ABI_$$t}; \
src=target/$$t/debug/zeromount; \
if [ -f "$$src" ]; then \
mkdir -p $(MODULE)/bin/$$abi; \
cp "$$src" $(MODULE)/bin/$$abi/zeromount; \
echo " $$abi <- $$src"; \
fi; \
done
install-release:
@for t in $(TARGETS); do \
abi=$${ABI_$$t}; \
src=target/$$t/release/zeromount; \
if [ -f "$$src" ]; then \
mkdir -p $(MODULE)/bin/$$abi; \
cp "$$src" $(MODULE)/bin/$$abi/zeromount; \
echo " $$abi <- $$src"; \
fi; \
done
check:
@$(CARGO) check --target aarch64-linux-android
clean:
$(CARGO) clean