config.mk 2.88 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
6
ZATHURA_VERSION_REV = 5
7
# If the API changes, the API version and the ABI version have to be bumped.
8
ZATHURA_API_VERSION = 2
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
# the GTK+ version to use
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
ZATHURA_GTK_VERSION ?= 3

# version checks
# If you want to disable any of the checks, set *_VERSION_CHECK to 0.

# girara
GIRARA_VERSION_CHECK ?= 1
GIRARA_MIN_VERSION = 0.1.8
GIRARA_PKG_CONFIG_NAME = girara-gtk$(ZATHURA_GTK_VERSION)
# glib
GLIB_VERSION_CHECK ?= 1
GLIB_MIN_VERSION = 2.28
GLIB_PKG_CONFIG_NAME = glib-2.0
# GTK
GTK_VERSION_CHECK ?= 1
GTK_MIN_VERSION = 2.18
GTK_PKG_CONFIG_NAME = gtk+-$(ZATHURA_GTK_VERSION).0
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 41 42
# paths
PREFIX ?= /usr
MANPREFIX ?= ${PREFIX}/share/man
43
DESKTOPPREFIX ?= ${PREFIX}/share/applications
44 45
LIBDIR ?= ${PREFIX}/lib
INCLUDEDIR ?= ${PREFIX}/include
46

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

# rst2man
RSTTOMAN ?= /usr/bin/rst2man
54

55
# libs
56
GTK_INC ?= $(shell pkg-config --cflags gtk+-${ZATHURA_GTK_VERSION}.0)
57 58 59 60 61 62 63
GTK_LIB ?= $(shell pkg-config --libs gtk+-${ZATHURA_GTK_VERSION}.0)

GTHREAD_INC ?= $(shell pkg-config --cflags gthread-2.0)
GTHREAD_LIB ?= $(shell pkg-config --libs   gthread-2.0)

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

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

68 69 70
GIRARA_INC ?= $(shell pkg-config --cflags girara-gtk${ZATHURA_GTK_VERSION})
GIRARA_LIB ?= $(shell pkg-config --libs girara-gtk${ZATHURA_GTK_VERSION})

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

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

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

84 85
# flags
CFLAGS += -std=c99 -pedantic -Wall -Wno-format-zero-length -Wextra $(INCS)
86

87 88 89 90 91
# debug
DFLAGS ?= -g

# ld
LDFLAGS += -rdynamic
92

93 94
# compiler
CC ?= gcc
95 96

# strip
97
SFLAGS ?= -s
98

99 100 101
# msgfmt
MSGFMT ?= msgfmt

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

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