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

4 5 6
# project
PROJECT = zathura

7
ZATHURA_VERSION_MAJOR = 0
8
ZATHURA_VERSION_MINOR = 3
9
ZATHURA_VERSION_REV = 5
10
# If the API changes, the API version and the ABI version have to be bumped.
11
ZATHURA_API_VERSION = 2
12
# If the ABI breaks for any reason, this has to be bumped.
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
21
GIRARA_MIN_VERSION = 0.2.5
22
GIRARA_PKG_CONFIG_NAME = girara-gtk3
23 24
# glib
GLIB_VERSION_CHECK ?= 1
25
GLIB_MIN_VERSION = 2.32
26 27 28
GLIB_PKG_CONFIG_NAME = glib-2.0
# GTK
GTK_VERSION_CHECK ?= 1
29
GTK_MIN_VERSION = 3.6
30
GTK_PKG_CONFIG_NAME = gtk+-3.0
31

32 33 34
# pkg-config binary
PKG_CONFIG ?= pkg-config

35
# database
36
# To disable support for the sqlite backend set WITH_SQLITE to 0.
37
WITH_SQLITE ?= $(shell (${PKG_CONFIG} --atleast-version=3.5.9 sqlite3 && echo 1) || echo 0)
38

39
# synctex
40 41
# To disable support for synctex with libsynctex set WITH_SYNCTEX to 0.
WITH_SYNCTEX ?= $(shell (${PKG_CONFIG} synctex && echo 1) || echo 0)
42

43 44 45 46
# mimetype detection
# To disable support for mimetype detction with libmagic set WITH_MAGIC to 0.
WITH_MAGIC ?= 1

47 48 49
# paths
PREFIX ?= /usr
MANPREFIX ?= ${PREFIX}/share/man
50
DESKTOPPREFIX ?= ${PREFIX}/share/applications
51
APPDATAPREFIX ?= ${PREFIX}/share/appdata
52 53
LIBDIR ?= ${PREFIX}/lib
INCLUDEDIR ?= ${PREFIX}/include
54 55
DBUSINTERFACEDIR ?= ${PREFIX}/share/dbus-1/interfaces
VIMFTPLUGINDIR ?= ${PREFIX}/share/vim/addons/ftplugin
56 57 58 59 60 61
DEPENDDIR ?= .depend
BUILDDIR ?= build
BUILDDIR_RELEASE ?= ${BUILDDIR}/release
BUILDDIR_DEBUG ?= ${BUILDDIR}/debug
BUILDDIR_GCOV ?= ${BUILDDIR}/gcov
BINDIR ?= bin
62

63 64 65 66 67 68
# plugin directory
PLUGINDIR ?= ${LIBDIR}/zathura
# locale directory
LOCALEDIR ?= ${PREFIX}/share/locale

# libs
69 70
GTK_INC ?= $(shell ${PKG_CONFIG} --cflags gtk+-3.0)
GTK_LIB ?= $(shell ${PKG_CONFIG} --libs gtk+-3.0)
71

72 73
GTHREAD_INC ?= $(shell ${PKG_CONFIG} --cflags gthread-2.0)
GTHREAD_LIB ?= $(shell ${PKG_CONFIG} --libs   gthread-2.0)
74

75 76
GMODULE_INC ?= $(shell ${PKG_CONFIG} --cflags gmodule-no-export-2.0)
GMODULE_LIB ?= $(shell ${PKG_CONFIG} --libs   gmodule-no-export-2.0)
77

78 79
GLIB_INC ?= $(shell ${PKG_CONFIG} --cflags glib-2.0)
GLIB_LIB ?= $(shell ${PKG_CONFIG} --libs glib-2.0)
80

81 82
GIRARA_INC ?= $(shell ${PKG_CONFIG} --cflags girara-gtk3)
GIRARA_LIB ?= $(shell ${PKG_CONFIG} --libs girara-gtk3)
83

84
ifneq (${WITH_SQLITE},0)
85 86
SQLITE_INC ?= $(shell ${PKG_CONFIG} --cflags sqlite3)
SQLITE_LIB ?= $(shell ${PKG_CONFIG} --libs sqlite3)
87
endif
88

89 90 91 92 93
ifneq (${WITH_MAGIC},0)
MAGIC_INC ?=
MAGIC_LIB ?= -lmagic
endif

94
ifneq ($(WITH_SYNCTEX),0)
95 96
SYNCTEX_INC ?= $(shell ${PKG_CONFIG} --cflags synctex)
SYNCTEX_LIB ?= $(shell ${PKG_CONFIG} --libs synctex)
97
endif
98

99 100
INCS = ${GIRARA_INC} ${GTK_INC} ${GTHREAD_INC} ${GMODULE_INC} ${GLIB_INC}
LIBS = ${GIRARA_LIB} ${GTK_LIB} ${GTHREAD_LIB} ${GMODULE_LIB} ${GLIB_LIB} -lpthread -lm
101

102 103 104 105 106
# pre-processor flags
CPPFLAGS += -D_FILE_OFFSET_BITS=64

# compiler flags
CFLAGS += -std=c11 -pedantic -Wall -Wno-format-zero-length -Wextra $(INCS)
107

108 109 110
# debug
DFLAGS ?= -g

111
# linker flags
112
LDFLAGS += -rdynamic
113

114 115
# compiler
CC ?= gcc
116 117

# strip
118
SFLAGS ?= -s
119

120 121 122
# msgfmt
MSGFMT ?= msgfmt

123 124 125 126 127 128 129 130 131 132
# 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

133 134 135 136 137 138
# 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

139
# set to something != 0 if you want verbose build output
140
VERBOSE ?= 0
141

142 143 144
# gettext package name
GETTEXT_PACKAGE ?= ${PROJECT}

145 146 147 148 149 150
# colors
COLOR ?= 1

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