Refactor android jni makefiles

This commit is contained in:
Aaron Kling 2018-04-06 14:09:55 -05:00
parent 4214a7aa93
commit 7da76cf0f8

View File

@ -1,40 +1,19 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
INCLUDES :=
SOURCES_C :=
CORE_DIR := $(LOCAL_PATH)/..
SOURCE_DIR := $(CORE_DIR)/src
INCFLAGS := -I$(SOURCE_DIR)/deps/libretro-common/include
INCLUDES :=
SOURCES_C :=
SOURCES_CXX :=
SOURCE_DIR := $(LOCAL_PATH)/../src
INCFLAGS := -I$(SOURCE_DIR)/deps/libretro-common/include
include $(CORE_DIR)/Makefile.common
GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
ifneq ($(GIT_VERSION)," unknown")
LOCAL_CXXFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
endif
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
endif
CORE_DIR := ../..
LOCAL_MODULE := libretro
include ../Makefile.common
LOCAL_SRC_FILES = $(SOURCES_C)
LOCAL_CFLAGS += -DANDROID -D__LIBRETRO__ -DHAVE_STRINGS_H -DRIGHTSHIFT_IS_SAR $(INCFLAGS)
COREFLAGS := -DANDROID -D__LIBRETRO__ -DHAVE_STRINGS_H -DRIGHTSHIFT_IS_SAR $(INCFLAGS)
include $(CLEAR_VARS)
LOCAL_MODULE := retro
LOCAL_SRC_FILES := $(SOURCES_C)
LOCAL_CFLAGS := $(COREFLAGS)
LOCAL_LDFLAGS := -Wl,-version-script=$(CORE_DIR)/link.T
include $(BUILD_SHARED_LIBRARY)