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

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

13 14 15 16 17
# 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
18
GIRARA_MIN_VERSION = 0.1.8
19
GIRARA_PKG_CONFIG_NAME = girara-gtk3
20 21 22 23 24 25
# glib
GLIB_VERSION_CHECK ?= 1
GLIB_MIN_VERSION = 2.28
GLIB_PKG_CONFIG_NAME = glib-2.0
# GTK
GTK_VERSION_CHECK ?= 1
26 27
GTK_MIN_VERSION = 3.0
GTK_PKG_CONFIG_NAME = gtk+-3.0
28

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

33 34 35 36
# mimetype detection
# To disable support for mimetype detction with libmagic set WITH_MAGIC to 0.
WITH_MAGIC ?= 1

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

46
# plugin directory
47
PLUGINDIR ?= ${LIBDIR}/zathura
48 49
# locale directory
LOCALEDIR ?= ${PREFIX}/share/locale
50

51 52 53
# rst2man
RSTTOMAN ?= /usr/bin/rst2man

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

80 81
INCS = ${GIRARA_INC} ${GTK_INC} ${GTHREAD_INC} ${GMODULE_INC} ${GLIB_INC}
LIBS = ${GIRARA_LIB} ${GTK_LIB} ${GTHREAD_LIB} ${GMODULE_LIB} ${GLIB_LIB} -lpthread -lm
82 83

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

86
# debug
87
DFLAGS ?= -g
88

89
# ld
90
LDFLAGS += -rdynamic
91

92
# compiler
Moritz Lipp's avatar
Moritz Lipp committed
93
CC ?= gcc
Moritz Lipp's avatar
Moritz Lipp committed
94 95

# strip
96
SFLAGS ?= -s
97

98 99 100
# msgfmt
MSGFMT ?= msgfmt

101 102 103 104 105 106
# 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

107 108
# set to something != 0 if you want verbose build output
VERBOSE ?= 0
109