config.mk 1.79 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
VERSION_MINOR = 3
Sebastian Ramacher's avatar
Sebastian Ramacher committed
5
VERSION_REV = 2
6
VERSION = ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}
Moritz Lipp's avatar
Moritz Lipp committed
7

8 9
PKG_CONFIG ?= pkg-config

10
# minimum required zathura version
11
ZATHURA_MIN_VERSION = 0.3.8
12

13
ZATHURA_VERSION_CHECK ?= $(shell $(PKG_CONFIG) --atleast-version=$(ZATHURA_MIN_VERSION) zathura; echo $$?)
14

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

# libs
21 22 23
CAIRO_INC ?= $(shell $(PKG_CONFIG) --cflags cairo)
CAIRO_LIB ?= $(shell $(PKG_CONFIG) --libs cairo)

24 25
GTK_INC ?= $(shell $(PKG_CONFIG) --cflags gtk+-3.0)
GTK_LIB ?= $(shell $(PKG_CONFIG) --libs gtk+-3.0)
26

27 28
GIRARA_INC ?= $(shell $(PKG_CONFIG) --cflags girara-gtk3)
GIRARA_LIB ?= $(shell $(PKG_CONFIG) --libs girara-gtk3)
Sebastian Ramacher's avatar
Sebastian Ramacher committed
29

30 31
ZATHURA_INC ?= $(shell $(PKG_CONFIG) --cflags zathura)
PLUGINDIR ?= $(shell $(PKG_CONFIG) --variable=plugindir zathura)
Sebastian Ramacher's avatar
Sebastian Ramacher committed
32 33 34
ifeq (,${PLUGINDIR})
PLUGINDIR = ${LIBDIR}/zathura
endif
35

36 37
OPENSSL_INC ?= $(shell $(PKG_CONFIG) --cflags libcrypto)
OPENSSL_LIB ?= $(shell $(PKG_CONFIG) --libs libcrypto)
Sebastian Ramacher's avatar
Sebastian Ramacher committed
38

39 40
FREETYPE_INC ?= $(shell $(PKG_CONFIG) --cflags freetype2)
FREETYPE_LIB ?= $(shell $(PKG_CONFIG) --libs freetype2)
41

42 43
HARFBUZZ_INC ?= $(shell $(PKG_CONFIG) --cflags harfbuzz)
HARFBUZZ_LIB ?= $(shell $(PKG_CONFIG) --libs harfbuzz)
44

45
MUPDF_LIB ?= -lmupdf -lmupdfthird
Moritz Lipp's avatar
Moritz Lipp committed
46

47 48
INCS = ${GTK_INC} ${GIRARA_INC} ${OPENSSL_INC} ${CAIRO_INC} ${ZATHURA_INC} ${FREETYPE_INC} ${HARFBUZZ_INC}
LIBS = ${GTK_LIB} ${GIRARA_LIB} ${MUPDF_LIB} ${OPENSSL_LIB} ${CAIRO_LIB} ${FREETYPE_LIB} ${HARFBUZZ_LIB} -ljbig2dec -lopenjp2 -ljpeg -lz
49

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

Sebastian Ramacher's avatar
Sebastian Ramacher committed
53 54 55
# linker flags
LDFLAGS += -fPIC

56
# debug
57 58
DFLAGS ?= -g

59 60 61
# compiler
CC ?= gcc
LD ?= ld
Moritz Lipp's avatar
Moritz Lipp committed
62 63 64

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