Fix overbuild in android deps.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4202 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-03-07 03:02:16 +00:00
parent 992b123853
commit 1c10768aa4

View File

@ -27,9 +27,15 @@ ANDROID_NDK ?= /usr/lib/android-sdk/ndk-bundle
ANDROID_NDK_API_VERSION := 30
ANDROID_NDK_TARGET_TRIPLE := aarch64-linux-android
debug windebug androiddebug: CFLAGS += -Og
ANDROID_TARGETS := \
out/androiddebug/tildefriends \
out/androiddebug/libtildefriends.so \
out/androidrelease/tildefriends \
out/androidrelease/libtildefriends.so
debug windebug $(ANDROID_TARGETS): CFLAGS += -Og
debug release androidrelease: LDFLAGS += -rdynamic
androiddebug androidrelease: CFLAGS += --sysroot $(ANDROID_SDK)/ndk-bundle/sysroot -fPIC
$(ANDROID_TARGETS): CFLAGS += --sysroot $(ANDROID_SDK)/ndk-bundle/sysroot -fPIC
release winrelease: CFLAGS += -DNDEBUG -O3
windebug winrelease: CC = x86_64-w64-mingw32-gcc-win32
windebug winrelease: AS = $(CC)
@ -42,13 +48,13 @@ windebug winrelease: LDFLAGS += \
-static \
-lm \
-Ldeps/openssl/mingw64/lib
androiddebug androidrelease: CC = $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
androiddebug androidrelease: AS = $(CC)
androiddebug androidrelease: CFLAGS += \
$(ANDROID_TARGETS): CC = $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
$(ANDROID_TARGETS): AS = $(CC)
$(ANDROID_TARGETS): CFLAGS += \
-target $(ANDROID_NDK_TARGET_TRIPLE)$(ANDROID_NDK_API_VERSION) \
-Ideps/openssl/android/arm64-v8a/usr/local/include \
-Wno-unknown-warning-option
androiddebug androidrelease: LDFLAGS += \
$(ANDROID_TARGETS): LDFLAGS += \
-target $(ANDROID_NDK_TARGET_TRIPLE)$(ANDROID_NDK_API_VERSION) \
-Ldeps/openssl/android/arm64-v8a/usr/local/lib
@ -319,7 +325,7 @@ windebug winrelease: LDFLAGS += \
-lcrypto \
-lws2_32 \
-lcrypt32
androiddebug androidrelease: LDFLAGS += \
$(ANDROID_TARGETS): LDFLAGS += \
-ldl \
-lssl \
-lcrypto \
@ -384,7 +390,7 @@ out/apk/classes.dex: $(CLASS_FILES)
@echo [dx] $@
@$(ANDROID_BUILD_TOOLS)/dx --dex --output=$@ out/classes/
out/TildeFriends.unsigned.apk: out/apk/classes.dex androiddebug
out/TildeFriends.unsigned.apk: out/apk/classes.dex out/androiddebug/libtildefriends.so
@mkdir -p $(dir $@) out/apk/lib/arm64-v8a/
@echo [aapt] $@
@cp out/androiddebug/libtildefriends.so out/apk/lib/arm64-v8a/