Skip to content

Commit

Permalink
Cleaned up makefile.
Browse files Browse the repository at this point in the history
  • Loading branch information
i5hi committed May 13, 2022
1 parent fe17558 commit 66e4fed
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ SOURCES=$(sort $(wildcard ./src/*.rs ./src/**/*.rs))
OS_NAME=$(shell uname | tr '[:upper:]' '[:lower:]')
PATH := $(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/$(OS_NAME)-x86_64/bin:$(PATH)

ANDROID_AARCH64_LINKER=$(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/$(OS_NAME)-x86_64/bin/aarch64-linux-android30-clang
ANDROID_ARMV7_LINKER=$(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/$(OS_NAME)-x86_64/bin/armv7a-linux-androideabi30-clang
ANDROID_I686_LINKER=$(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/$(OS_NAME)-x86_64/bin/i686-linux-android30-clang
ANDROID_X86_64_LINKER=$(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/$(OS_NAME)-x86_64/bin/x86_64-linux-android30-clang
ANDROID_AARCH64_CLANG=$(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/$(OS_NAME)-x86_64/bin/aarch64-linux-android30-clang
ANDROID_ARMV7_CLANG=$(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/$(OS_NAME)-x86_64/bin/armv7a-linux-androideabi30-clang
ANDROID_I686_CLANG=$(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/$(OS_NAME)-x86_64/bin/i686-linux-android30-clang
ANDROID_X86_64_CLANG=$(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/$(OS_NAME)-x86_64/bin/x86_64-linux-android30-clang

LD_LIBRARY_PATH=$(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/$(OS_NAME)-x86_64/lib
LDFLAGS=--sysroot=$(ANDROID_NDK_HOME)/sysroot
Expand Down Expand Up @@ -58,31 +58,28 @@ android: target/aarch64-linux-android/release/libstackmate.so target/armv7-linux

target/aarch64-linux-android/release/libstackmate.so: $(SOURCES) ndk-home
LDFLAGS=$(LDFLAGS) \
CC=$(ANDROID_AARCH64_LINKER) \
CC=$(ANDROID_AARCH64_CLANG) \
PKG_CONFIG_ALLOW_CROSS=1 OPENSSL_STATIC=1 \
cargo build --target aarch64-linux-android --release
@echo "[DONE] $@"

target/armv7-linux-androideabi/release/libstackmate.so: $(SOURCES) ndk-home
LDFLAGS=$(LDFLAGS) \
CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER=$(ANDROID_ARMV7_LINKER) \
CC=$(ANDROID_ARMV7_LINKER) LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) \
CC=$(ANDROID_ARMV7_CLANG) \
PKG_CONFIG_ALLOW_CROSS=1 OPENSSL_STATIC=1 \
cargo build --target armv7-linux-androideabi --release
@echo "[DONE] $@"

target/i686-linux-android/release/libstackmate.so: $(SOURCES) ndk-home
LDFLAGS=$(LDFLAGS) \
CARGO_TARGET_I686_LINUX_ANDROID_LINKER=$(ANDROID_I686_LINKER) \
CC=$(ANDROID_I686_LINKER) LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) \
CC=$(ANDROID_I686_CLANG) \
PKG_CONFIG_ALLOW_CROSS=1 OPENSSL_STATIC=1 \
cargo build --target i686-linux-android --release
@echo "[DONE] $@"

target/x86_64-linux-android/release/libstackmate.so: $(SOURCES) ndk-home
LDFLAGS=$(LDFLAGS) \
CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER=$(ANDROID_X86_64_LINKER) \
CC=$(ANDROID_X86_64_LINKER) LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) \
CC=$(ANDROID_X86_64_CLANG) \
PKG_CONFIG_ALLOW_CROSS=1 OPENSSL_STATIC=1 \
cargo build --target x86_64-linux-android --release
@echo "[DONE] $@"
Expand Down

0 comments on commit 66e4fed

Please sign in to comment.