aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2013-06-18 17:53:06 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2013-06-18 17:53:06 +0000
commitbea01fce3f52132445028e787b1a343351db6c9b (patch)
tree266b9d71cafeb9053529fe99a8cfacca444ce705 /Makefile
parentff0dd596938d558812c2d67fcb1bbbca8aa51686 (diff)
update Android build for NDK r8eHEADsvn2git-headexternals/template
svn path=/trunk/externals/template/; revision=17152
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 14 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 036b29a..0d5b73e 100644
--- a/Makefile
+++ b/Makefile
@@ -139,21 +139,28 @@ ifeq ($(UNAME),ANDROID)
SHARED_EXTENSION = so
OS = android
PD_PATH = /usr
- NDK_BASE := /usr/local/android-ndk
+ NDK_BASE := /opt/android-ndk
NDK_PLATFORM_LEVEL ?= 5
NDK_ABI=arm
+ NDK_COMPILER_VERSION = 4.6
NDK_SYSROOT=$(NDK_BASE)/platforms/android-$(NDK_PLATFORM_LEVEL)/arch-$(NDK_ABI)
- NDK_UNAME := $(shell uname -s | tr '[A-Z]' '[a-z]')
- NDK_COMPILER_VERSION=4.6
- NDK_TOOLCHAIN=$(wildcard \
- $(NDK_BASE)/toolchains/$(NDK_ABI)*-$(NDK_COMPILER_VERSION)/prebuilt/$(NDK_UNAME)-x86)
- CC := $(wildcard $(NDK_TOOLCHAIN)/bin/*-linux-android*-gcc) --sysroot=$(NDK_SYSROOT)
+ NDK_UNAME:=$(shell uname -s | tr '[A-Z]' '[a-z]')
+ ifeq ($(NDK_ABI),x86)
+ HOST = i686-linux-android
+ NDK_TOOLCHAIN = $(NDK_ABI)-$(NDK_COMPILER_VERSION)
+ else
+ HOST = $(NDK_ABI)-linux-androideabi
+ NDK_TOOLCHAIN = $(HOST)-$(NDK_COMPILER_VERSION)
+ endif
+ NDK_TOOLCHAIN_BASE=$(NDK_BASE)/toolchains/$(NDK_TOOLCHAIN)/prebuilt/$(NDK_UNAME)-$(NDK_PROCESSOR)
+ CC := $(NDK_TOOLCHAIN_BASE)/bin/$(HOST)-gcc --sysroot=$(NDK_SYSROOT)
+ LD := $(NDK_TOOLCHAIN_BASE)/bin/$(HOST)-ld
OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
CFLAGS +=
LDFLAGS += -rdynamic -shared
SHARED_LDFLAGS += -Wl,-soname,$(SHARED_LIB) -shared
LIBS += -lc $(LIBS_android)
- STRIP := $(wildcard $(NDK_TOOLCHAIN)/bin/$(NDK_ABI)-linux-android*-strip) \
+ STRIP := $(NDK_TOOLCHAIN_BASE)/bin/$(HOST)-strip) \
--strip-unneeded -R .note -R .comment
DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m)
endif