From 76bab6bbd7fc1dd6a924a08a1bd62db08c8e7f0e Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 3 Jan 2011 22:20:40 +0000 Subject: first stab at a working android build setup svn path=/trunk/externals/template/; revision=14689 --- Makefile | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 85c6d23..af82e49 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -## Pd library template version 1.0.6 +## Pd library template version 1.0.7 # For instructions on how to use this template, see: # http://puredata.info/docs/developer/MakefileTemplate LIBRARY_NAME = template @@ -109,6 +109,25 @@ ifeq ($(UNAME),Darwin) pkglibdir=$(HOME)/Library/Pd endif endif +# Tho Android uses Linux, we use this fake uname to provide an easy way to +# setup all this things needed to cross-compile for Android using the NDK +ifeq ($(UNAME),ANDROID) + CPU := arm + SOURCES += $(SOURCES_android) + EXTENSION = pd_linux + OS = android + PD_PATH = /usr + NDK_BASE=/usr/local/android-ndk + NDK_SYSROOT=$(NDK_BASE)/platforms/android-5/arch-arm + NDK_TOOLCHAIN=$(NDK_BASE)/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86 + CC=$(NDK_TOOLCHAIN)/bin/arm-linux-androideabi-gcc + OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer + CFLAGS += -fPIC + LDFLAGS += -Wl,--export-dynamic -L$(NDK_SYSROOT)/usr/lib -shared -fPIC + LIBS += -lc + STRIP = strip --strip-unneeded -R .note -R .comment + DISTBINDIR=$(DISTDIR)-$(OS)-$(shell uname -m) +endif ifeq ($(UNAME),Linux) CPU := $(shell uname -m) SOURCES += $(SOURCES_linux) -- cgit v1.2.1