From 33483b52654822b58390ebd2711b13b2dece8740 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 13 Oct 2011 20:19:30 +0200 Subject: Add skeleton iOS viewer project. Support cross compiling for iPhone and iPad targets using the makefile. --- Makerules | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'Makerules') diff --git a/Makerules b/Makerules index 63a75d6a..43ba78e5 100644 --- a/Makerules +++ b/Makerules @@ -34,6 +34,7 @@ ifeq "$(OS)" "Darwin" SYS_FREETYPE_INC := -I/usr/X11R6/include/freetype2 CFLAGS += -I/usr/X11R6/include LDFLAGS += -L/usr/X11R6/lib +RANLIB_CMD = ranlib $@ X11_LIBS := -lX11 -lXext ifeq "$(arch)" "amd64" CFLAGS += -m64 @@ -56,6 +57,7 @@ endif # cygwin) # 2) do a non cross compile build (e.g. windows in MSVC) first. # 3) download the generated files from mupdf.com. + ifeq "$(OS)" "beagle-cross" CC = arm-none-linux-gnueabi-gcc LD = arm-none-linux-gnueabi-gcc @@ -82,3 +84,23 @@ CFLAGS += -O3 -mcpu=arm1136jf-s -mfpu=vfp -mfloat-abi=softfp -ffast-math -fsingl CROSSCOMPILE=yes NOX11=yes endif + +ifeq "$(OS)" "iphonesimulator" +CC = $(PLATFORM_DEVELOPER_BIN_DIR)/gcc +AR = $(PLATFORM_DEVELOPER_BIN_DIR)/ar +CFLAGS += -arch i386 -isysroot $(SDKROOT) +LDFLAGS += -arch i386 -isysroot $(SDKROOT) +RANLIB_CMD = $(PLATFORM_DEVELOPER_BIN_DIR)/ranlib $@ +CROSSCOMPILE=yes +NOX11=yes +endif + +ifeq "$(OS)" "iphoneos" +CC = $(PLATFORM_DEVELOPER_BIN_DIR)/gcc +AR = $(PLATFORM_DEVELOPER_BIN_DIR)/ar +CFLAGS += -arch armv7 -isysroot $(SDKROOT) +LDFLAGS += -arch armv7 -isysroot $(SDKROOT) +RANLIB_CMD = $(PLATFORM_DEVELOPER_BIN_DIR)/ranlib $@ +CROSSCOMPILE=yes +NOX11=yes +endif -- cgit v1.2.3 From 93a08378e62b5d9ca3ea1b54ce8f5be2995201f1 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 21 Oct 2011 02:13:08 +0200 Subject: Tweak build scripts for iOS viewer. --- Makerules | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'Makerules') diff --git a/Makerules b/Makerules index 43ba78e5..a4ce91b3 100644 --- a/Makerules +++ b/Makerules @@ -85,21 +85,15 @@ CROSSCOMPILE=yes NOX11=yes endif -ifeq "$(OS)" "iphonesimulator" -CC = $(PLATFORM_DEVELOPER_BIN_DIR)/gcc -AR = $(PLATFORM_DEVELOPER_BIN_DIR)/ar -CFLAGS += -arch i386 -isysroot $(SDKROOT) -LDFLAGS += -arch i386 -isysroot $(SDKROOT) -RANLIB_CMD = $(PLATFORM_DEVELOPER_BIN_DIR)/ranlib $@ -CROSSCOMPILE=yes -NOX11=yes -endif +# Most variables when building for iOS are set up in ios/build_libs.sh, +# which is called from the Xcode project as a "Run Script" build step. +# The following section works for both device and simulator builds. -ifeq "$(OS)" "iphoneos" +ifeq "$(OS)" "ios" +# sadly, llvm generates invalid arm code when compiling freetype, +# so no clang or llvm-gcc for us :( CC = $(PLATFORM_DEVELOPER_BIN_DIR)/gcc AR = $(PLATFORM_DEVELOPER_BIN_DIR)/ar -CFLAGS += -arch armv7 -isysroot $(SDKROOT) -LDFLAGS += -arch armv7 -isysroot $(SDKROOT) RANLIB_CMD = $(PLATFORM_DEVELOPER_BIN_DIR)/ranlib $@ CROSSCOMPILE=yes NOX11=yes -- cgit v1.2.3 From c9987c352a3cd23f1ef5f5d5ffa444fb3634ffdd Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 23 Oct 2011 03:18:14 +0200 Subject: Update project to Xcode 4. --- Makerules | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Makerules') diff --git a/Makerules b/Makerules index a4ce91b3..2fe704e9 100644 --- a/Makerules +++ b/Makerules @@ -90,9 +90,7 @@ endif # The following section works for both device and simulator builds. ifeq "$(OS)" "ios" -# sadly, llvm generates invalid arm code when compiling freetype, -# so no clang or llvm-gcc for us :( -CC = $(PLATFORM_DEVELOPER_BIN_DIR)/gcc +CC = $(PLATFORM_DEVELOPER_BIN_DIR)/clang AR = $(PLATFORM_DEVELOPER_BIN_DIR)/ar RANLIB_CMD = $(PLATFORM_DEVELOPER_BIN_DIR)/ranlib $@ CROSSCOMPILE=yes -- cgit v1.2.3