config.mk 3.01 KB
Newer Older
1
2
3
# See LICENSE file for license and copyright information
# zathura make config

Moritz Lipp's avatar
Moritz Lipp committed
4
5
6
# project
PROJECT = zathura

7
ZATHURA_VERSION_MAJOR = 0
8
ZATHURA_VERSION_MINOR = 2
Moritz Lipp's avatar
Moritz Lipp committed
9
ZATHURA_VERSION_REV = 8
Sebastian Ramacher's avatar
Sebastian Ramacher committed
10
# If the API changes, the API version and the ABI version have to be bumped.
Sebastian Ramacher's avatar
Sebastian Ramacher committed
11
ZATHURA_API_VERSION = 2
Sebastian Ramacher's avatar
Sebastian Ramacher committed
12
# If the ABI breaks for any reason, this has to be bumped.
Sebastian Ramacher's avatar
Sebastian Ramacher committed
13
ZATHURA_ABI_VERSION = 2
14
VERSION = ${ZATHURA_VERSION_MAJOR}.${ZATHURA_VERSION_MINOR}.${ZATHURA_VERSION_REV}
15

16
17
18
19
20
# version checks
# If you want to disable any of the checks, set *_VERSION_CHECK to 0.

# girara
GIRARA_VERSION_CHECK ?= 1
Moritz Lipp's avatar
Moritz Lipp committed
21
GIRARA_MIN_VERSION = 0.2.0
22
GIRARA_PKG_CONFIG_NAME = girara-gtk3
23
24
25
26
27
28
# glib
GLIB_VERSION_CHECK ?= 1
GLIB_MIN_VERSION = 2.28
GLIB_PKG_CONFIG_NAME = glib-2.0
# GTK
GTK_VERSION_CHECK ?= 1
29
30
GTK_MIN_VERSION = 3.0
GTK_PKG_CONFIG_NAME = gtk+-3.0
Sebastian Ramacher's avatar
Sebastian Ramacher committed
31

32
# database
33
# To disable support for the sqlite backend set WITH_SQLITE to 0.
34
WITH_SQLITE ?= $(shell (pkg-config --atleast-version=3.5.9 sqlite3 && echo 1) || echo 0)
35

36
37
38
39
# mimetype detection
# To disable support for mimetype detction with libmagic set WITH_MAGIC to 0.
WITH_MAGIC ?= 1

40
# paths
Moritz Lipp's avatar
Moritz Lipp committed
41
42
PREFIX ?= /usr
MANPREFIX ?= ${PREFIX}/share/man
Pavel Borzenkov's avatar
Pavel Borzenkov committed
43
DESKTOPPREFIX ?= ${PREFIX}/share/applications
44
45
LIBDIR ?= ${PREFIX}/lib
INCLUDEDIR ?= ${PREFIX}/include
Sebastian Ramacher's avatar
Sebastian Ramacher committed
46
47
DBUSINTERFACEDIR ?= ${PREFIX}/share/dbus-1/interfaces
VIMFTPLUGINDIR ?= ${PREFIX}/share/vim/addons/ftplugin
Moritz Lipp's avatar
Moritz Lipp committed
48

49
# plugin directory
50
PLUGINDIR ?= ${LIBDIR}/zathura
51
52
# locale directory
LOCALEDIR ?= ${PREFIX}/share/locale
53
54

# libs
55
56
GTK_INC ?= $(shell pkg-config --cflags gtk+-3.0)
GTK_LIB ?= $(shell pkg-config --libs gtk+-3.0)
57

Moritz Lipp's avatar
Moritz Lipp committed
58
59
60
GTHREAD_INC ?= $(shell pkg-config --cflags gthread-2.0)
GTHREAD_LIB ?= $(shell pkg-config --libs   gthread-2.0)

61
62
63
GMODULE_INC ?= $(shell pkg-config --cflags gmodule-no-export-2.0)
GMODULE_LIB ?= $(shell pkg-config --libs   gmodule-no-export-2.0)

64
65
GLIB_INC ?= $(shell pkg-config --cflags glib-2.0)
GLIB_LIB ?= $(shell pkg-config --libs glib-2.0)
66

67
68
GIRARA_INC ?= $(shell pkg-config --cflags girara-gtk3)
GIRARA_LIB ?= $(shell pkg-config --libs girara-gtk3)
69

70
ifneq (${WITH_SQLITE},0)
71
72
SQLITE_INC ?= $(shell pkg-config --cflags sqlite3)
SQLITE_LIB ?= $(shell pkg-config --libs sqlite3)
73
endif
74

75
76
77
78
79
ifneq (${WITH_MAGIC},0)
MAGIC_INC ?=
MAGIC_LIB ?= -lmagic
endif

Sebastian Ramacher's avatar
Sebastian Ramacher committed
80
81
82
83
84
ZLIB_INC ?= $(shell pkg-config --cflags zlib)
ZLIB_LIB ?= $(shell pkg-config --libs zlib)

INCS = ${GIRARA_INC} ${GTK_INC} ${GTHREAD_INC} ${GMODULE_INC} ${GLIB_INC} $(ZLIB_INC)
LIBS = ${GIRARA_LIB} ${GTK_LIB} ${GTHREAD_LIB} ${GMODULE_LIB} ${GLIB_LIB} $(ZLIB_LIB) -lpthread -lm
85
86

# flags
Sebastian Ramacher's avatar
Sebastian Ramacher committed
87
CFLAGS += -std=c99 -pedantic -Wall -Wno-format-zero-length -Wextra $(INCS)
88

89
# debug
90
DFLAGS ?= -g
91

92
# ld
93
LDFLAGS += -rdynamic
94

95
# compiler
Moritz Lipp's avatar
Moritz Lipp committed
96
CC ?= gcc
Moritz Lipp's avatar
Moritz Lipp committed
97
98

# strip
99
SFLAGS ?= -s
Sebastian Ramacher's avatar
Sebastian Ramacher committed
100

101
102
103
# msgfmt
MSGFMT ?= msgfmt

Moritz Lipp's avatar
Moritz Lipp committed
104
105
106
107
108
109
# valgrind
VALGRIND = valgrind
VALGRIND_ARGUMENTS = --tool=memcheck --leak-check=yes --leak-resolution=high \
	--show-reachable=yes --log-file=zathura-valgrind.log
VALGRIND_SUPPRESSION_FILE = zathura.suppression

Sebastian Ramacher's avatar
Sebastian Ramacher committed
110
111
# set to something != 0 if you want verbose build output
VERBOSE ?= 0
112

Moritz Lipp's avatar
Moritz Lipp committed
113
114
# colors
COLOR ?= 1
Moritz Lipp's avatar
Moritz Lipp committed
115
116
117
118

# dist
TARFILE = ${PROJECT}-${VERSION}.tar.gz
TARDIR = ${PROJECT}-${VERSION}