Make a JNI call.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4200 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
16
Makefile
16
Makefile
@ -29,6 +29,7 @@ ANDROID_NDK_TARGET_TRIPLE := aarch64-linux-android
|
||||
|
||||
debug windebug androiddebug: CFLAGS += -Og
|
||||
debug release androidrelease: LDFLAGS += -rdynamic
|
||||
androiddebug androidrelease: 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)
|
||||
@ -321,7 +322,9 @@ windebug winrelease: LDFLAGS += \
|
||||
androiddebug androidrelease: LDFLAGS += \
|
||||
-ldl \
|
||||
-lssl \
|
||||
-lcrypto
|
||||
-lcrypto \
|
||||
-shared \
|
||||
-fPIC
|
||||
|
||||
unix: debug release
|
||||
win: windebug winrelease
|
||||
@ -343,10 +346,10 @@ DEPS = $(ALL_APP_OBJS:.o=.d)
|
||||
-include $(DEPS)
|
||||
|
||||
define build_rules
|
||||
$(1): $(BUILD_DIR)/$(1)/$(PROJECT)$(if $(filter win%,$(1)),.exe)
|
||||
$(1): $(BUILD_DIR)/$(1)/$(if $(filter android%,$(1)),lib)$(PROJECT)$(if $(filter win%,$(1)),.exe)$(if $(filter android%,$(1)),.so)
|
||||
.PHONY: $(1)
|
||||
|
||||
$(BUILD_DIR)/$(1)/$(PROJECT)$(if $(filter win%,$(1)),.exe): $(filter $(BUILD_DIR)/$(1)/%,$(ALL_APP_OBJS))
|
||||
$(BUILD_DIR)/$(1)/$(if $(filter android%,$(1)),lib)$(PROJECT)$(if $(filter win%,$(1)),.exe)$(if $(filter android%,$(1)),.so): $(filter $(BUILD_DIR)/$(1)/%,$(ALL_APP_OBJS))
|
||||
@echo [link] $$@
|
||||
@$$(CC) -o $$@ $$^ $$(LDFLAGS)
|
||||
|
||||
@ -381,9 +384,12 @@ out/apk/classes.dex: $(CLASS_FILES)
|
||||
@echo [dx] $@
|
||||
@$(ANDROID_BUILD_TOOLS)/dx --dex --output=$@ out/classes/
|
||||
|
||||
out/TildeFriends.unsigned.apk: out/apk/classes.dex
|
||||
@mkdir -p $(dir $@)
|
||||
out/TildeFriends.unsigned.apk: out/apk/classes.dex androiddebug
|
||||
@mkdir -p $(dir $@) out/apk/lib/arm64-v8a/
|
||||
@echo [aapt] $@
|
||||
@cp out/androiddebug/libtildefriends.so out/apk/lib/arm64-v8a/
|
||||
@cp deps/openssl/android/arm64-v8a/usr/local/lib/libssl.so out/apk/lib/arm64-v8a/
|
||||
@cp deps/openssl/android/arm64-v8a/usr/local/lib/libcrypto.so out/apk/lib/arm64-v8a/
|
||||
@$(ANDROID_BUILD_TOOLS)/aapt package -f -M src/android/AndroidManifest.xml -S src/android/res/ -I $(ANDROID_PLATFORM)/android.jar -F $@ out/apk/
|
||||
|
||||
out/TildeFriends.apk: out/TildeFriends.unsigned.apk
|
||||
|
Reference in New Issue
Block a user