config.mk 1.52 KB
Newer Older
1 2
# See LICENSE file for license and copyright information

3
VERSION_MAJOR = 0
Moritz Lipp's avatar
Moritz Lipp committed
4 5
VERSION_MINOR = 3
VERSION_REV = 0
6
VERSION = ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}
Moritz Lipp's avatar
Moritz Lipp committed
7

8
# minimum required zathura version
9
ZATHURA_MIN_VERSION = 0.2.0
10

11
ZATHURA_VERSION_CHECK ?= $(shell pkg-config --atleast-version=$(ZATHURA_MIN_VERSION) zathura; echo $$?)
12
ZATHURA_GTK_VERSION ?= $(shell pkg-config --variable=GTK_VERSION zathura)
13

14 15
# paths
PREFIX ?= /usr
Sebastian Ramacher's avatar
Sebastian Ramacher committed
16
LIBDIR ?= ${PREFIX}/lib
17
DESKTOPPREFIX ?= ${PREFIX}/share/applications
18 19

# libs
20 21
GTK_INC ?= $(shell pkg-config --cflags gtk+-${ZATHURA_GTK_VERSION}.0)
GTK_LIB ?= $(shell pkg-config --libs gtk+-${ZATHURA_GTK_VERSION}.0)
22

23 24
GIRARA_INC ?= $(shell pkg-config --cflags girara-gtk${ZATHURA_GTK_VERSION})
GIRARA_LIB ?= $(shell pkg-config --libs girara-gtk${ZATHURA_GTK_VERSION})
Sebastian Ramacher's avatar
Sebastian Ramacher committed
25

26
ZATHURA_INC ?= $(shell pkg-config --cflags zathura)
27
PLUGINDIR ?= $(shell pkg-config --variable=plugindir zathura)
Sebastian Ramacher's avatar
Sebastian Ramacher committed
28 29 30
ifeq (,${PLUGINDIR})
PLUGINDIR = ${LIBDIR}/zathura
endif
31

Sebastian Ramacher's avatar
Sebastian Ramacher committed
32 33 34
OPENSSL_INC ?= $(shell pkg-config --cflags libcrypto)
OPENSSL_LIB ?= $(shell pkg-config --libs libcrypto)

Moritz Lipp's avatar
Moritz Lipp committed
35
MUPDF_LIB ?= -lmupdf -lmujs
Moritz Lipp's avatar
Moritz Lipp committed
36 37

INCS = ${GTK_INC} ${GIRARA_INC} ${OPENSSL_INC} ${ZATHURA_INC}
Sebastian Ramacher's avatar
Sebastian Ramacher committed
38
LIBS = ${GTK_LIB} ${GIRARA_LIB} ${MUPDF_LIB} ${OPENSSL_LIB} -ljbig2dec -lopenjp2 -ljpeg
39

Sebastian Ramacher's avatar
Sebastian Ramacher committed
40
# compiler flags
41 42
CFLAGS += -std=c99 -fPIC -pedantic -Wall -Wno-format-zero-length $(INCS)

Sebastian Ramacher's avatar
Sebastian Ramacher committed
43 44 45
# linker flags
LDFLAGS += -fPIC

46
# debug
47 48 49 50
DFLAGS ?= -g

# build with cairo support?
WITH_CAIRO ?= 1
51 52 53 54

# compiler
CC ?= gcc
LD ?= ld
Moritz Lipp's avatar
Moritz Lipp committed
55 56 57

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