2014-02-19 02:54:27 +01:00
|
|
|
ARCH = arm
|
|
|
|
SHAREDLIBSUFFIX = so
|
|
|
|
GCCVERSION = 4.8
|
2014-02-20 05:49:30 +01:00
|
|
|
NDKLEVEL = 12
|
2014-02-19 02:54:27 +01:00
|
|
|
HOSTOS = $(shell uname | tr A-Z a-z | tr -d \\-[:digit:].)
|
|
|
|
HOSTARCH = $(shell uname -m)
|
|
|
|
ifeq ($(ARCH), arm)
|
|
|
|
GCCPATHPREFIX = arm-linux-androideabi
|
|
|
|
GCCPREFIX = arm-linux-androideabi
|
|
|
|
CFLAGS += -march=armv7-a -mfloat-abi=softfp
|
2014-02-25 22:46:50 +01:00
|
|
|
ifeq (Yes, $(HAVE_NEON))
|
2014-02-19 02:54:27 +01:00
|
|
|
CFLAGS += -mfpu=neon
|
2014-02-25 22:46:50 +01:00
|
|
|
else
|
2014-02-20 11:00:15 +01:00
|
|
|
CFLAGS += -mfpu=vfpv3-d16
|
2014-02-25 22:46:50 +01:00
|
|
|
endif
|
2014-02-19 02:54:27 +01:00
|
|
|
LDFLAGS += -march=armv7-a -Wl,--fix-cortex-a8
|
|
|
|
APP_ABI = armeabi-v7a
|
|
|
|
else
|
|
|
|
GCCPATHPREFIX = x86
|
|
|
|
GCCPREFIX = i686-linux-android
|
|
|
|
APP_ABI = x86
|
2014-02-25 22:46:50 +01:00
|
|
|
ifeq (Yes, $(USE_ASM))
|
2014-02-25 22:52:36 +01:00
|
|
|
ASM_ARCH = x86
|
2014-02-20 02:31:21 +01:00
|
|
|
CFLAGS += -DX86_ASM
|
|
|
|
ASMFLAGS += -DNOPREFIX -f elf32 -DX86_32
|
2014-02-25 22:46:50 +01:00
|
|
|
endif
|
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-02-19 02:54:27 +01:00
|
|
|
CXX = $(NDKROOT)/toolchains/$(GCCPATHPREFIX)-$(GCCVERSION)/prebuilt/$(HOSTOS)-$(HOSTARCH)/bin/$(GCCPREFIX)-g++
|
2014-02-20 11:11:58 +01:00
|
|
|
CC = $(NDKROOT)/toolchains/$(GCCPATHPREFIX)-$(GCCVERSION)/prebuilt/$(HOSTOS)-$(HOSTARCH)/bin/$(GCCPREFIX)-gcc
|
|
|
|
AR = $(NDKROOT)/toolchains/$(GCCPATHPREFIX)-$(GCCVERSION)/prebuilt/$(HOSTOS)-$(HOSTARCH)/bin/$(GCCPREFIX)-ar
|
2014-02-20 11:20:14 +01:00
|
|
|
CFLAGS += -DLINUX -fpic --sysroot=$(SYSROOT)
|
|
|
|
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 = \
|
|
|
|
-I$(NDKROOT)/sources/cxx-stl/gnu-libstdc++/$(GCCVERSION)/include \
|
|
|
|
-I$(NDKROOT)/sources/cxx-stl/gnu-libstdc++/$(GCCVERSION)/libs/$(APP_ABI)/include
|
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 = \
|
|
|
|
$(NDKROOT)/sources/cxx-stl/gnu-libstdc++/$(GCCVERSION)/libs/$(APP_ABI)/libgnustl_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
|