summaryrefslogtreecommitdiff
path: root/Makerules
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2011-04-25 13:15:26 +0100
committerRobin Watts <Robin.Watts@artifex.com>2011-04-25 13:15:26 +0100
commitb86564890124c50fb711a0ce8ff42143a36c7a67 (patch)
tree8571786e021d9e6297a7f0b04b6a2b3373ba7a0f /Makerules
parent345a7bb9ee91f047b9c450c7f935df1e5b1fc553 (diff)
downloadmupdf-b86564890124c50fb711a0ce8ff42143a36c7a67.tar.xz
Makefile tweaks for cross compiling, plus example cross compile target.
Add 2 new makefile options to Mupdf. If CROSSCOMPILE is defined, then we avoid performing tasks during the build that require a binary to be built and then executed as part of the build. Currently this is just the cmap and font dumping steps. If NOX11 is defined, then we avoid building the X11 app. Finally, in Makerules, we have a new section to show how to encapsulate the changes for a given cross compile target. If OS is defined to be "beagle-cross" then we build using given compilers/options.
Diffstat (limited to 'Makerules')
-rw-r--r--Makerules17
1 files changed, 17 insertions, 0 deletions
diff --git a/Makerules b/Makerules
index 486f8adc..54e568c1 100644
--- a/Makerules
+++ b/Makerules
@@ -43,3 +43,20 @@ CFLAGS += -m32
LDFLAGS += -m32
endif
endif
+
+# The following section is an example of how to simply do cross-compilation
+# using these Makefiles. It builds for a beagleboard running ARM linux,
+# compiling on windows with the CodeSourcery G++ compilers.
+# Invoke this as:
+# make OS=beagle-cross build=release
+# This does rely on the generated directory being populated with the cmap
+# files etc first. Either do a non cross compile build (e.g. windows in MSVC
+# or windows in cygwin) first, or download the generated files from mupdf.com.
+ifeq "$(OS)" "beagle-cross"
+CC = arm-none-linux-gnueabi-gcc
+LD = arm-none-linux-gnueabi-gcc
+AR = arm-none-linux-gnueabi-ar
+CFLAGS += -O3 -mfpu=neon -mcpu=cortex-a8 -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant
+CROSSCOMPILE=yes
+NOX11=yes
+endif