Skip to content

Commit 755047a

Browse files
committedApr 7, 2018
Refactor android jni makefiles
1 parent 410326f commit 755047a

File tree

1 file changed

+12
-28
lines changed

1 file changed

+12
-28
lines changed
 

‎jni/Android.mk

+12-28
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,24 @@
11
LOCAL_PATH := $(call my-dir)
22

3-
include $(CLEAR_VARS)
3+
CORE_DIR := $(LOCAL_PATH)/..
4+
5+
include $(CORE_DIR)/Makefile.common
46

5-
GIT_VERSION ?= " $(shell git rev-parse --short HEAD || echo unknown)"
7+
COREFLAGS := $(DEFS) $(COREDEFS) $(CPUDEFS) $(SOUNDDEFS) $(ASMDEFS) $(DBGDEFS) -ffast-math -funroll-loops -Dstricmp=strcasecmp -DANDROID $(INCFLAGS)
8+
9+
GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
610
ifneq ($(GIT_VERSION)," unknown")
7-
LOCAL_CFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
11+
COREFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
812
endif
913

14+
include $(CLEAR_VARS)
1015
LOCAL_MODULE := retro
16+
LOCAL_SRC_FILES := $(SOURCES_C)
17+
LOCAL_CFLAGS := -std=gnu99 $(COREFLAGS)
18+
LOCAL_LDFLAGS := -Wl,-version-script=$(CORE_DIR)/link.T
1119

12-
ifeq ($(TARGET_ARCH),arm)
13-
LOCAL_CFLAGS += -DANDROID_ARM
14-
LOCAL_ARM_MODE := arm
1520
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
16-
LOCAL_CFLAGS += -D__ARM_NEON__ -mfpu=neon
17-
endif
18-
endif
19-
20-
ifeq ($(TARGET_ARCH),x86)
21-
LOCAL_CFLAGS += -DANDROID_X86
21+
LOCAL_ARM_NEON := true
2222
endif
2323

24-
ifeq ($(TARGET_ARCH),mips)
25-
LOCAL_CFLAGS += -DANDROID_MIPS -D__mips__ -D__MIPSEL__
26-
endif
27-
28-
CORE_ROOT_DIR := ..
29-
CORE_DIR := $(CORE_ROOT_DIR)
30-
31-
include $(CORE_ROOT_DIR)/Makefile.common
32-
33-
LOCAL_SRC_FILES += $(SOURCES_C)
34-
35-
LOCAL_C_INCLUDES = $(INCFLAGS)
36-
37-
LOCAL_CFLAGS += $(DEFS) $(COREDEFS) $(CPUDEFS) $(SOUNDDEFS) $(ASMDEFS) $(DBGDEFS)
38-
LOCAL_CFLAGS += -O3 -std=gnu99 -ffast-math -funroll-loops -Dstricmp=strcasecmp -DANDROID $(INCFLAGS)
39-
4024
include $(BUILD_SHARED_LIBRARY)

0 commit comments

Comments
 (0)
Please sign in to comment.