summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--Makerules17
2 files changed, 21 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 38b49c5a..209fce11 100644
--- a/Makefile
+++ b/Makefile
@@ -106,8 +106,10 @@ $(GEN)/font_cjk.h : $(FONT_CJK_SRC)
CMAP_HDR := $(addprefix $(GEN)/, cmap_cns.h cmap_gb.h cmap_japan.h cmap_korea.h)
FONT_HDR := $(GEN)/font_base14.h $(GEN)/font_droid.h $(GEN)/font_cjk.h
+ifeq "$(CROSSCOMPILE)" ""
$(CMAP_HDR) : $(CMAPDUMP) | $(GEN)
$(FONT_HDR) : $(FONTDUMP) | $(GEN)
+endif
$(OUT)/pdf_cmap_table.o : $(CMAP_HDR)
$(OUT)/pdf_fontfile.o : $(FONT_HDR)
@@ -123,8 +125,10 @@ $(XPS_APPS) : $(MUXPS_LIB) $(FITZ_LIB) $(THIRD_LIBS)
MUPDF := $(OUT)/mupdf
$(MUPDF) : $(MUXPS_LIB) $(MUPDF_LIB) $(FITZ_LIB) $(THIRD_LIBS)
+ifeq "$(NOX11)" ""
$(MUPDF) : $(addprefix $(OUT)/, x11_main.o x11_image.o pdfapp.o)
$(LINK_CMD) $(X11_LIBS)
+endif
# --- Install ---
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