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-03-03 22:19:29 +01:00
|
|
|
CFLAGS += -DLINUX -DANDROID_NDK -DMT_ENABLED -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)
|
|
|
|
SHLDFLAGS = -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,-soname,libwels.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-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-02-20 11:21:14 +01:00
|
|
|
CODEC_UNITTEST_LDFLAGS_SUFFIX = \
|
2014-03-06 07:15:36 +01:00
|
|
|
$(NDKROOT)/sources/cxx-stl/stlport/libs/$(APP_ABI)/libstlport_static.a
|
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
|
|
|
|
|
|
|
COMMON_INCLUDES += -I$(NDKROOT)/sources/android/cpufeatures
|
|
|
|
COMMON_OBJS += $(COMMON_SRCDIR)/cpu-features.o
|
|
|
|
|
|
|
|
codec/common/cpu-features.o: $(NDKROOT)/sources/android/cpufeatures/cpu-features.c
|
|
|
|
$(QUIET_CC)$(CC) $(CFLAGS) $(INCLUDES) $(COMMON_CFLAGS) $(COMMON_INCLUDES) -c $(CXX_O) $<
|