summaryrefslogtreecommitdiff
path: root/Makerules
blob: 6fa2de8f1d78172977e6369040bcdfc89e38e781 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Configuration for the Makefile

OS := $(shell uname)
OS := $(OS:MINGW%=MINGW)

CFLAGS := -Wall -Ifitz -Imupdf
LDFLAGS :=
CC := cc
LD := $(CC)
AR := ar

ifeq "$(build)" "debug"
CFLAGS += -g -O0 -DDEBUG
endif

ifeq "$(build)" "release"
CFLAGS += -O3 -DNDEBUG
endif

ifeq "$(OS)" "Linux"
SYS_FREETYPE_INC := `pkg-config --cflags freetype2`
SYS_FREETYPE_LIB := `pkg-config --libs freetype2`

X11LIBS := -lX11 -lXext
PDFVIEW_EXE = $(X11VIEW_EXE)

ifeq "$(build)" "release"
CFLAGS += -mmmx -ftree-vectorize -msse -msse2 -march=k8 -DARCH_X86
DRAW_ARCH_SRC := archx86.c
endif

endif

ifeq "$(OS)" "Darwin"
SYS_FREETYPE_INC := -I/usr/X11R6/include/freetype2
CFLAGS += -I/usr/X11R6/include
LDFLAGS += -L/usr/X11R6/lib

X11LIBS := -lX11 -lXext
PDFVIEW_EXE = $(X11VIEW_EXE)

ifeq "$(arch)" "amd64"
CFLAGS += -m64
LDFLAGS += -m64
else
CFLAGS += -m32
LDFLAGS += -m32
endif

ifeq "$(build)" "release"
ifeq "$(arch)" "amd64"
CFLAGS += -DARCH_X86_64
else
CFLAGS += -DARCH_X86
endif
DRAW_ARCH_SRC := archx86.c
endif

endif

# MinGW build depends on thirdparty
ifeq "$(OS)" "MINGW"
CC = gcc
W32LIBS := -lgdi32 -lcomdlg32 -luser32 -ladvapi32 -lshell32 -mwindows
PDFVIEW_EXE = $(WINVIEW_EXE)
endif