2014-02-19 02:54:27 +01:00
|
|
|
ARCH = arm
|
2014-03-05 14:17:29 +01:00
|
|
|
include 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-03-06 02:32:03 +01:00
|
|
|
TOOLCHAINPREFIX = $(shell NDK_PROJECT_PATH=./codec/build/android/dec make --no-print-dir -f $(NDKROOT)/build/core/build-local.mk DUMP_TOOLCHAIN_PREFIX APP_ABI=armeabi)
|
2014-02-26 14:00:35 +01:00
|
|
|
ifeq (Yes, $(USE_ASM))
|
|
|
|
ASMFLAGS += -march=armv7-a -mfpu=neon
|
|
|
|
endif
|
2014-03-07 14:02:15 +01:00
|
|
|
else ifeq ($(ARCH), x86)
|
2014-02-19 02:54:27 +01:00
|
|
|
APP_ABI = x86
|
2014-03-06 02:32:03 +01:00
|
|
|
TOOLCHAINPREFIX = $(shell NDK_PROJECT_PATH=./codec/build/android/dec make --no-print-dir -f $(NDKROOT)/build/core/build-local.mk DUMP_TOOLCHAIN_PREFIX APP_ABI=x86)
|
2014-02-25 22:46:50 +01:00
|
|
|
ifeq (Yes, $(USE_ASM))
|
2014-03-15 11:47:03 +01:00
|
|
|
ASMFLAGS += -f elf32
|
2014-02-25 22:46:50 +01:00
|
|
|
endif
|
2014-03-07 14:02:15 +01:00
|
|
|
else
|
|
|
|
APP_ABI = $(ARCH)
|
|
|
|
TOOLCHAINPREFIX = $(shell NDK_PROJECT_PATH=./codec/build/android/dec make --no-print-dir -f $(NDKROOT)/build/core/build-local.mk DUMP_TOOLCHAIN_PREFIX APP_ABI=$(APP_ABI))
|
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
|
|
|
|
|
|
|
|
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-05-12 11:06:16 +02:00
|
|
|
CFLAGS += -DANDROID_NDK -fpic --sysroot=$(SYSROOT)
|
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-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
|
|
|
|
|
|
|
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:
|
|
|
|
cd ./codec/build/android/dec && $(NDKROOT)/ndk-build APP_ABI=$(APP_ABI) clean && ant clean
|
|
|
|
clean_Android_enc:
|
|
|
|
cd ./codec/build/android/enc && $(NDKROOT)/ndk-build APP_ABI=$(APP_ABI) clean && ant clean
|
|
|
|
|
2014-03-01 21:20:39 +01:00
|
|
|
COMMON_INCLUDES += -I$(NDKROOT)/sources/android/cpufeatures
|
2014-03-18 10:21:46 +01:00
|
|
|
COMMON_OBJS += $(COMMON_SRCDIR)/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-03-18 10:21:46 +01:00
|
|
|
codec/common/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) $<
|