aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2009-10-22 17:09:15 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2009-10-22 17:09:15 +0000
commit69f9fee34958006778d0bf3a7e501ef5f8092aea (patch)
tree186d508e4979ad2ebca977d4c9982dae571cb53f /Makefile
parentf35331b8491a2e46819d4e9afb0e364b65f92513 (diff)
added cross-compiling for the iPhone OS when building on Mac OS X
svn path=/trunk/externals/ext13/; revision=12639
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile40
1 files changed, 30 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 6fc3897..5e0e33b 100644
--- a/Makefile
+++ b/Makefile
@@ -29,16 +29,34 @@ LIBS =
UNAME := $(shell uname -s)
ifeq ($(UNAME),Darwin)
- SOURCES += $(SOURCES_Darwin)
- EXTENSION = pd_darwin
- OS = macosx
- OPT_CFLAGS = -ftree-vectorize -ftree-vectorizer-verbose=2 -fast
- FAT_FLAGS = -arch i386 -arch ppc -mmacosx-version-min=10.4
- CFLAGS += -fPIC $(FAT_FLAGS)
- LDFLAGS += -bundle -undefined dynamic_lookup $(FAT_FLAGS)
- LIBS += -lc
- STRIP = strip -x
- endif
+ CPU := $(shell uname -p)
+ ifeq ($(CPU),arm) # iPhone/iPod Touch
+ SOURCES += $(SOURCES_Darwin)
+ EXTENSION = pd_darwin
+ OS = iphoneos
+ IPHONE_BASE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
+ CC=$(IPHONE_BASE)/gcc
+ CPP=$(IPHONE_BASE)/cpp
+ CXX=$(IPHONE_BASE)/g++
+ ISYSROOT = -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk
+ IPHONE_CFLAGS = -miphoneos-version-min=3.0 $(ISYSROOT) -arch armv6
+ OPT_CFLAGS = -fast -funroll-loops -fomit-frame-pointer
+ CFLAGS := $(IPHONE_CFLAGS) $(OPT_CFLAGS) $(CFLAGS)
+ LDFLAGS += -arch armv6 -bundle -undefined dynamic_lookup $(ISYSROOT)
+ LIBS += -lc
+ STRIP = strip -x
+ else # Mac OS X
+ SOURCES += $(SOURCES_Darwin)
+ EXTENSION = pd_darwin
+ OS = macosx
+ OPT_CFLAGS = -ftree-vectorize -ftree-vectorizer-verbose=2 -fast
+ FAT_FLAGS = -arch i386 -arch ppc -mmacosx-version-min=10.4
+ CFLAGS += -fPIC $(FAT_FLAGS)
+ LDFLAGS += -bundle -undefined dynamic_lookup $(FAT_FLAGS)
+ LIBS += -lc
+ STRIP = strip -x
+ endif
+endif
ifeq ($(UNAME),Linux)
SOURCES += $(SOURCES_Linux)
EXTENSION = pd_linux
@@ -150,3 +168,5 @@ showpaths:
@echo "objectsdir: $(objectsdir)"
@echo "LIBRARY_NAME: $(LIBRARY_NAME)"
@echo "SOURCES: $(SOURCES)"
+ @echo "UNAME: $(UNAME)"
+ @echo "CPU: $(CPU)"