config.mk 3.94 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
Moritz Lipp's avatar
Moritz Lipp committed
8
ZATHURA_VERSION_MINOR = 3
Moritz Lipp's avatar
Moritz Lipp committed
9
ZATHURA_VERSION_REV = 7
Sebastian Ramacher's avatar
Sebastian Ramacher committed
10
# If the API changes, the API version and the ABI version have to be bumped.
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.
13
ZATHURA_ABI_VERSION = 3
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.7
22
GIRARA_PKG_CONFIG_NAME = girara-gtk3
23 24
# glib
GLIB_VERSION_CHECK ?= 1
25
GLIB_MIN_VERSION = 2.50
26 27 28
GLIB_PKG_CONFIG_NAME = glib-2.0
# GTK
GTK_VERSION_CHECK ?= 1
Sebastian Ramacher's avatar
Sebastian Ramacher committed
29
GTK_MIN_VERSION = 3.6
30
GTK_PKG_CONFIG_NAME = gtk+-3.0
31

Sebastian Ramacher's avatar
Sebastian Ramacher committed
32 33 34
# pkg-config binary
PKG_CONFIG ?= pkg-config

35 36 37
# glib-compile-resources
GLIB_COMPILE_RESOURCES ?= glib-compile-resources

38
# database
39
# To disable support for the sqlite backend set WITH_SQLITE to 0.
Sebastian Ramacher's avatar
Sebastian Ramacher committed
40
WITH_SQLITE ?= $(shell (${PKG_CONFIG} --atleast-version=3.5.9 sqlite3 && echo 1) || echo 0)
41

42
# synctex
Sebastian Ramacher's avatar
Sebastian Ramacher committed
43
# To disable support for synctex with libsynctex set WITH_SYNCTEX to 0.
44
WITH_SYNCTEX ?= $(shell (${PKG_CONFIG} synctex && echo 1) || echo 0)
45

46 47 48 49
# mimetype detection
# To disable support for mimetype detction with libmagic set WITH_MAGIC to 0.
WITH_MAGIC ?= 1

50
# paths
Moritz Lipp's avatar
Moritz Lipp committed
51 52
PREFIX ?= /usr
MANPREFIX ?= ${PREFIX}/share/man
Pavel Borzenkov's avatar
Pavel Borzenkov committed
53
DESKTOPPREFIX ?= ${PREFIX}/share/applications
Sebastian Ramacher's avatar
Sebastian Ramacher committed
54
APPDATAPREFIX ?= ${PREFIX}/share/appdata
55 56
LIBDIR ?= ${PREFIX}/lib
INCLUDEDIR ?= ${PREFIX}/include
Sebastian Ramacher's avatar
Sebastian Ramacher committed
57 58
DBUSINTERFACEDIR ?= ${PREFIX}/share/dbus-1/interfaces
VIMFTPLUGINDIR ?= ${PREFIX}/share/vim/addons/ftplugin
Moritz Lipp's avatar
Moritz Lipp committed
59 60 61 62 63 64
DEPENDDIR ?= .depend
BUILDDIR ?= build
BUILDDIR_RELEASE ?= ${BUILDDIR}/release
BUILDDIR_DEBUG ?= ${BUILDDIR}/debug
BUILDDIR_GCOV ?= ${BUILDDIR}/gcov
BINDIR ?= bin
65

66
# plugin directory
67
PLUGINDIR ?= ${LIBDIR}/zathura
68 69
# locale directory
LOCALEDIR ?= ${PREFIX}/share/locale
70 71

# libs
72 73 74 75 76 77
ifeq (${GTK_INC}-${GTK_LIB},-)
PKG_CONFIG_LIBS += gtk+-3.0
else
INCS += ${GTK_INC}
LIBS += ${GTK_LIB}
endif
78

79 80 81 82 83 84
ifeq (${GLIB_INC}-${GLIB_LIB},-)
PKG_CONFIG_LIBS += gthread-2.0 gmodule-no-export-2.0 glib-2.0
else
INCS += ${GLIB_INC}
LIBS += ${GLIB_LIB}
endif
85

86 87 88 89 90 91
ifeq (${GIRARA_INC}-${GIRARA_LIB},-)
PKG_CONFIG_LIBS += girara-gtk3
else
INCS += ${GIRARA_INC}
LIBS += ${GIRARA_LIB}
endif
92

93
ifneq (${WITH_SQLITE},0)
94 95 96 97 98 99
ifeq (${SQLITE_INC}-${SQLITE_LIB},-)
PKG_CONFIG_LIBS += sqlite3
else
INCS += ${SQLITE_INC}
LIBS += ${SQLITE_LIB}
endif
100
endif
101

102 103 104
ifneq (${WITH_MAGIC},0)
MAGIC_INC ?=
MAGIC_LIB ?= -lmagic
105 106 107

INCS += ${MAGIC_INC}
LIBS += ${MAGIC_LIB}
108 109
endif

110
ifneq ($(WITH_SYNCTEX),0)
111 112 113 114 115 116
ifeq (${SYNCTEX_INC}-${SYNCTEX_LIB},-)
PKG_CONFIG_LIBS += synctex
else
INCS += ${SYNCTEX_INC}
LIBS += ${SYNCTEX_LIB}
endif
117
endif
Sebastian Ramacher's avatar
Sebastian Ramacher committed
118

119 120 121 122 123
ifneq (${PKG_CONFIG_LIBS},)
INCS += $(shell ${PKG_CONFIG} --cflags ${PKG_CONFIG_LIBS})
LIBS += $(shell ${PKG_CONFIG} --libs ${PKG_CONFIG_LIBS})
endif
LIBS += -lpthread -lm
124

Sebastian Ramacher's avatar
Sebastian Ramacher committed
125 126 127 128
# pre-processor flags
CPPFLAGS += -D_FILE_OFFSET_BITS=64

# compiler flags
Moritz Lipp's avatar
Moritz Lipp committed
129
CFLAGS += -std=c11 -pedantic -Wall -Wno-format-zero-length -Wextra $(INCS)
130

131
# debug
132
DFLAGS ?= -g
133

Sebastian Ramacher's avatar
Sebastian Ramacher committed
134
# linker flags
135
LDFLAGS += -rdynamic
136

137
# compiler
Moritz Lipp's avatar
Moritz Lipp committed
138
CC ?= gcc
Moritz Lipp's avatar
Moritz Lipp committed
139 140

# strip
141
SFLAGS ?= -s
142

143 144 145
# msgfmt
MSGFMT ?= msgfmt

Moritz Lipp's avatar
Moritz Lipp committed
146 147 148 149 150 151 152 153 154 155
# gcov & lcov
GCOV_CFLAGS=-fprofile-arcs -ftest-coverage
GCOV_LDFLAGS=-fprofile-arcs
LCOV_OUTPUT=gcov
LCOV_EXEC=lcov
LCOV_FLAGS=--base-directory . --directory ${BUILDDIR_GCOV} --capture --rc \
					 lcov_branch_coverage=1 --output-file ${BUILDDIR_GCOV}/$(PROJECT).info
GENHTML_EXEC=genhtml
GENHTML_FLAGS=--rc lcov_branch_coverage=1 --output-directory ${LCOV_OUTPUT} ${BUILDDIR_GCOV}/$(PROJECT).info

156 157 158 159 160 161
# 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

162 163
# set to something != 0 if you want verbose build output
VERBOSE ?= 0
164

165 166 167
# gettext package name
GETTEXT_PACKAGE ?= ${PROJECT}

Moritz Lipp's avatar
Moritz Lipp committed
168 169
# colors
COLOR ?= 1
Moritz Lipp's avatar
Moritz Lipp committed
170 171 172 173

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