From 5de89d61b3bdb6194a09c618fe152a36f0ca2ddb Mon Sep 17 00:00:00 2001 From: Aaron Kling Date: Thu, 5 Apr 2018 10:17:47 -0500 Subject: [PATCH] Refactor android jni makefiles --- jni/Android.mk | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/jni/Android.mk b/jni/Android.mk index d0041c1..6646767 100644 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -1,30 +1,20 @@ LOCAL_PATH := $(call my-dir) -GIT_VERSION := " $(shell git rev-parse --short HEAD)" -include $(CLEAR_VARS) - -LOCAL_MODULE := retro - -ifeq ($(TARGET_ARCH),arm) -LOCAL_CFLAGS += -DANDROID_ARM -LOCAL_ARM_MODE := arm -endif - -ifeq ($(TARGET_ARCH),x86) -LOCAL_CFLAGS += -DANDROID_X86 -endif - -ifeq ($(TARGET_ARCH),mips) -LOCAL_CFLAGS += -DANDROID_MIPS -D__mips__ -D__MIPSEL__ -endif - -CORE_DIR = .. +CORE_DIR := $(LOCAL_PATH)/.. include $(CORE_DIR)/Makefile.common -LOCAL_SRC_FILES += $(SOURCES_C) -LOCAL_CFLAGS += -O2 -D__LIBRETRO__ -DFRONTEND_SUPPORTS_RGB565 -DNDEBUG=1 -DGIT_VERSION=\"$(GIT_VERSION)\" $(INCFLAGS) +COREFLAGS := -D__LIBRETRO__ -DFRONTEND_SUPPORTS_RGB565 $(INCFLAGS) -LOCAL_LDLIBS += -lz -llog +GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)" +ifneq ($(GIT_VERSION)," unknown") + COREFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" +endif +include $(CLEAR_VARS) +LOCAL_MODULE := retro +LOCAL_SRC_FILES := $(SOURCES_C) +LOCAL_CFLAGS := $(COREFLAGS) +LOCAL_LDFLAGS := -Wl,-version-script=$(CORE_DIR)/link.T +LOCAL_LDLIBS := -llog -lz include $(BUILD_SHARED_LIBRARY)