2014-02-19 02:54:27 +01:00
|
|
|
ARCH = arm
|
2014-01-29 09:31:09 +01:00
|
|
|
include $(SRC_PATH)build/platform-arch.mk
|
2014-02-19 02:54:27 +01:00
|
|
|
SHAREDLIBSUFFIX = so
|
2014-02-20 05:49:30 +01:00
|
|
|
NDKLEVEL = 12
|
2014-02-19 02:54:27 +01:00
|
|
|
ifeq ($(ARCH), arm)
|
2014-03-01 01:09:25 +01:00
|
|
|
ifneq ($(APP_ABI), armeabi)
|
2014-02-19 02:54:27 +01:00
|
|
|
CFLAGS += -march=armv7-a -mfloat-abi=softfp
|
2014-02-20 11:00:15 +01:00
|
|
|
CFLAGS += -mfpu=vfpv3-d16
|
2014-02-19 02:54:27 +01:00
|
|
|
LDFLAGS += -march=armv7-a -Wl,--fix-cortex-a8
|
|
|
|
APP_ABI = armeabi-v7a
|
2014-03-01 01:09:25 +01:00
|
|
|
endif
|
2014-02-26 14:00:35 +01:00
|
|
|
ifeq (Yes, $(USE_ASM))
|
|
|
|
ASMFLAGS += -march=armv7-a -mfpu=neon
|
|
|
|
endif
|
2014-07-16 20:05:15 +02:00
|
|
|
else ifeq ($(ARCH), arm64)
|
|
|
|
APP_ABI = arm64-v8a
|
2014-03-07 14:02:15 +01:00
|
|
|
else ifeq ($(ARCH), x86)
|
2014-07-16 20:20:37 +02:00
|
|
|
APP_ABI = x86
|
2014-02-25 22:46:50 +01:00
|
|
|
ifeq (Yes, $(USE_ASM))
|
2014-07-24 23:50:09 +02:00
|
|
|
ASMFLAGS += -f elf
|
2014-02-25 22:46:50 +01:00
|
|
|
endif
|
2014-07-16 20:05:15 +02:00
|
|
|
else ifeq ($(ARCH), x86_64)
|
|
|
|
APP_ABI = x86_64
|
|
|
|
ifeq (Yes, $(USE_ASM))
|
|
|
|
ASMFLAGS += -f elf64
|
|
|
|
endif
|
2014-03-07 14:02:15 +01:00
|
|
|
else
|
2014-07-16 20:20:37 +02:00
|
|
|
APP_ABI = $(ARCH)
|
2014-02-19 02:54:27 +01:00
|
|
|
endif
|
|
|
|
|
2014-02-20 05:49:30 +01:00
|
|
|
ifndef NDKROOT
|
|
|
|
$(error NDKROOT is not set)
|
|
|
|
endif
|
|
|
|
ifndef TARGET
|
|
|
|
$(error TARGET is not set)
|
|
|
|
endif
|
|
|
|
|
2014-01-29 09:31:09 +01:00
|
|
|
TOOLCHAINPREFIX = $(shell NDK_PROJECT_PATH=$(SRC_PATH)/codec/build/android/dec make --no-print-dir -f $(NDKROOT)/build/core/build-local.mk DUMP_TOOLCHAIN_PREFIX APP_ABI=$(APP_ABI))
|
2014-07-09 10:10:33 +02:00
|
|
|
|
2014-02-20 05:49:30 +01:00
|
|
|
SYSROOT = $(NDKROOT)/platforms/android-$(NDKLEVEL)/arch-$(ARCH)
|
2014-03-06 02:32:03 +01:00
|
|
|
CXX = $(TOOLCHAINPREFIX)g++
|
|
|
|
CC = $(TOOLCHAINPREFIX)gcc
|
|
|
|
AR = $(TOOLCHAINPREFIX)ar
|
2014-06-26 13:56:46 +02:00
|
|
|
CFLAGS += -DANDROID_NDK -fpic --sysroot=$(SYSROOT) -MMD -MP
|
2014-02-20 11:20:14 +01:00
|
|
|
CXXFLAGS += -fno-rtti -fno-exceptions
|
2014-02-20 11:20:56 +01:00
|
|
|
LDFLAGS += --sysroot=$(SYSROOT)
|
2014-05-04 14:57:40 +02:00
|
|
|
SHLDFLAGS = -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,-soname,lib$(PROJECT_NAME).so
|
2014-02-19 02:54:27 +01:00
|
|
|
|
2014-07-24 00:07:17 +02:00
|
|
|
ifneq ($(CXX),$(wildcard $(CXX)))
|
|
|
|
$(error Compiler not found, bad NDKROOT or ARCH?)
|
|
|
|
endif
|
|
|
|
|
2014-02-20 11:07:57 +01:00
|
|
|
STL_INCLUDES = \
|
2014-03-06 07:15:36 +01:00
|
|
|
-I$(NDKROOT)/sources/cxx-stl/stlport/stlport
|
2014-06-25 08:05:30 +02:00
|
|
|
STL_LIB = \
|
|
|
|
$(NDKROOT)/sources/cxx-stl/stlport/libs/$(APP_ABI)/libstlport_static.a
|
2014-02-19 02:54:27 +01:00
|
|
|
|
2014-02-20 11:07:57 +01:00
|
|
|
GTEST_INCLUDES = $(STL_INCLUDES)
|
|
|
|
CODEC_UNITTEST_INCLUDES = $(STL_INCLUDES)
|
2014-06-25 08:05:30 +02:00
|
|
|
CODEC_UNITTEST_LDFLAGS_SUFFIX = $(STL_LIB)
|
2014-06-25 07:59:55 +02:00
|
|
|
MODULE_INCLUDES = $(STL_INCLUDES)
|
2014-06-25 08:05:30 +02:00
|
|
|
MODULE_LDFLAGS = $(STL_LIB)
|
2014-02-19 02:54:27 +01:00
|
|
|
|
2014-01-29 09:31:09 +01:00
|
|
|
ifeq (./,$(SRC_PATH))
|
2014-02-19 02:54:27 +01:00
|
|
|
binaries : decdemo encdemo
|
|
|
|
|
|
|
|
decdemo: libraries
|
2014-02-20 10:42:23 +01:00
|
|
|
cd ./codec/build/android/dec && $(NDKROOT)/ndk-build -B APP_ABI=$(APP_ABI) && android update project -t $(TARGET) -p . && ant debug
|
2014-02-19 02:54:27 +01:00
|
|
|
|
|
|
|
encdemo: libraries
|
2014-02-20 10:42:23 +01:00
|
|
|
cd ./codec/build/android/enc && $(NDKROOT)/ndk-build -B APP_ABI=$(APP_ABI) && android update project -t $(TARGET) -p . && ant debug
|
2014-03-01 21:20:39 +01:00
|
|
|
|
2014-06-05 03:23:19 +02:00
|
|
|
clean_Android: clean_Android_dec clean_Android_enc
|
2014-06-03 05:21:10 +02:00
|
|
|
|
|
|
|
clean_Android_dec:
|
2014-07-02 12:41:27 +02:00
|
|
|
-cd ./codec/build/android/dec && $(NDKROOT)/ndk-build APP_ABI=$(APP_ABI) clean && ant clean
|
2014-06-03 05:21:10 +02:00
|
|
|
clean_Android_enc:
|
2014-07-02 12:41:27 +02:00
|
|
|
-cd ./codec/build/android/enc && $(NDKROOT)/ndk-build APP_ABI=$(APP_ABI) clean && ant clean
|
2014-01-29 09:31:09 +01:00
|
|
|
else
|
|
|
|
all:
|
|
|
|
@:
|
|
|
|
clean_Android:
|
|
|
|
@:
|
|
|
|
endif
|
2014-06-03 05:21:10 +02:00
|
|
|
|
2014-03-01 21:20:39 +01:00
|
|
|
COMMON_INCLUDES += -I$(NDKROOT)/sources/android/cpufeatures
|
2014-07-02 12:39:26 +02:00
|
|
|
COMMON_OBJS += $(COMMON_SRCDIR)/src/cpu-features.$(OBJ)
|
2014-03-01 21:20:39 +01:00
|
|
|
|
2014-03-25 17:16:28 +01:00
|
|
|
COMMON_CFLAGS += \
|
|
|
|
-Dandroid_getCpuIdArm=wels_getCpuIdArm -Dandroid_setCpuArm=wels_setCpuArm \
|
|
|
|
-Dandroid_getCpuCount=wels_getCpuCount -Dandroid_getCpuFamily=wels_getCpuFamily \
|
|
|
|
-Dandroid_getCpuFeatures=wels_getCpuFeatures -Dandroid_setCpu=wels_setCpu \
|
|
|
|
|
2014-07-02 12:39:26 +02:00
|
|
|
codec/common/src/cpu-features.$(OBJ): $(NDKROOT)/sources/android/cpufeatures/cpu-features.c
|
2014-03-01 21:20:39 +01:00
|
|
|
$(QUIET_CC)$(CC) $(CFLAGS) $(INCLUDES) $(COMMON_CFLAGS) $(COMMON_INCLUDES) -c $(CXX_O) $<
|