From b86564890124c50fb711a0ce8ff42143a36c7a67 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Mon, 25 Apr 2011 13:15:26 +0100 Subject: 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. --- Makerules | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Makerules') 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 -- cgit v1.2.3