Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4680 | right-hear | 1 | # Configuration for the Makefile |
2 | |||
3 | OS ?= $(shell uname) |
||
4 | OS := $(OS:MINGW%=MINGW) |
||
5 | |||
6 | CFLAGS += -Wall |
||
7 | |||
8 | ifeq "$(build)" "debug" |
||
9 | CFLAGS += -pipe -g |
||
10 | else ifeq "$(build)" "profile" |
||
11 | CFLAGS += -pipe -O2 -DNDEBUG -pg |
||
12 | LDFLAGS += -pg |
||
13 | else ifeq "$(build)" "release" |
||
14 | CFLAGS += -pipe -O2 -DNDEBUG -fomit-frame-pointer |
||
15 | else ifeq "$(build)" "native" |
||
16 | CFLAGS += -pipe -O2 -DNDEBUG -fomit-frame-pointer -march=native -mfpmath=sse |
||
17 | else |
||
18 | $(error unknown build setting: '$(build)') |
||
19 | endif |
||
20 | |||
21 | ifeq "$(OS)" "Linux" |
||
22 | SYS_FREETYPE_INC := `pkg-config --cflags freetype2` |
||
23 | X11_LIBS := -lX11 -lXext |
||
24 | endif |
||
25 | |||
26 | ifeq "$(OS)" "FreeBSD" |
||
27 | SYS_FREETYPE_INC := `pkg-config --cflags freetype2` |
||
28 | LDFLAGS += -L/usr/local/lib |
||
29 | X11_LIBS := -lX11 -lXext |
||
30 | endif |
||
31 | |||
32 | # Mac OS X build depends on some thirdparty libs |
||
33 | ifeq "$(OS)" "Darwin" |
||
34 | SYS_FREETYPE_INC := -I/usr/X11R6/include/freetype2 |
||
35 | CFLAGS += -I/usr/X11R6/include |
||
36 | LDFLAGS += -L/usr/X11R6/lib |
||
37 | X11_LIBS := -lX11 -lXext |
||
38 | ifeq "$(arch)" "amd64" |
||
39 | CFLAGS += -m64 |
||
40 | LDFLAGS += -m64 |
||
41 | else |
||
42 | CFLAGS += -m32 |
||
43 | LDFLAGS += -m32 |
||
44 | endif |
||
45 | endif |
||
46 | |||
47 | # The following section is an example of how to simply do cross-compilation |
||
48 | # using these Makefiles. It builds for a beagleboard running ARM linux, |
||
49 | # compiling on windows with the CodeSourcery G++ compilers. |
||
50 | # Invoke this as: |
||
51 | # make OS=beagle-cross build=release |
||
52 | # This does rely on the generated directory being populated with the cmap |
||
53 | # files etc first. Either: |
||
54 | # 1) do 'make generate' first (this relies on you having an appropriate host |
||
55 | # base C compiler set up - such as you would have on unix or in windows |
||
56 | # cygwin) |
||
57 | # 2) do a non cross compile build (e.g. windows in MSVC) first. |
||
58 | # 3) download the generated files from mupdf.com. |
||
59 | ifeq "$(OS)" "beagle-cross" |
||
60 | CC = arm-none-linux-gnueabi-gcc |
||
61 | LD = arm-none-linux-gnueabi-gcc |
||
62 | AR = arm-none-linux-gnueabi-ar |
||
63 | CFLAGS += -O3 -mfpu=neon -mcpu=cortex-a8 -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant |
||
64 | CROSSCOMPILE=yes |
||
65 | NOX11=yes |
||
66 | endif |
||
67 | |||
68 | ifeq "$(OS)" "webos-pre-cross" |
||
69 | CC = arm-none-linux-gnueabi-gcc |
||
70 | LD = arm-none-linux-gnueabi-gcc |
||
71 | AR = arm-none-linux-gnueabi-ar |
||
72 | CFLAGS += -O3 -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -ffast-math -fsingle-precision-constant |
||
73 | CROSSCOMPILE=yes |
||
74 | NOX11=yes |
||
75 | endif |
||
76 | |||
77 | ifeq "$(OS)" "webos-pixi-cross" |
||
78 | CC = arm-none-linux-gnueabi-gcc |
||
79 | LD = arm-none-linux-gnueabi-gcc |
||
80 | AR = arm-none-linux-gnueabi-ar |
||
81 | CFLAGS += -O3 -mcpu=arm1136jf-s -mfpu=vfp -mfloat-abi=softfp -ffast-math -fsingle-precision-constant |
||
82 | CROSSCOMPILE=yes |
||
83 | NOX11=yes |
||
84 | endif |