config.mk 1.54 KB
Newer Older
Moritz Lipp's avatar
Moritz Lipp committed
1
2
# See LICENSE file for license and copyright information

3
VERSION_MAJOR = 0
Sebastian Ramacher's avatar
Sebastian Ramacher committed
4
VERSION_MINOR = 2
Sebastian Ramacher's avatar
Sebastian Ramacher committed
5
VERSION_REV = 7
6
VERSION = ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}
7

8
# minimum required zathura version
9
ZATHURA_MIN_VERSION = 0.3.8
10
ZATHURA_VERSION_CHECK ?= $(shell pkg-config --atleast-version=$(ZATHURA_MIN_VERSION) zathura; echo $$?)
11
ZATHURA_GTK_VERSION ?= $(shell pkg-config --variable=GTK_VERSION zathura)
12

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

# libs
Moritz Lipp's avatar
Moritz Lipp committed
19
20
21
CAIRO_INC ?= $(shell pkg-config --cflags cairo)
CAIRO_LIB ?= $(shell pkg-config --libs cairo)

Moritz Lipp's avatar
Moritz Lipp committed
22
23
GLIB_INC ?= $(shell pkg-config --cflags glib-2.0)
GLIB_LIB ?= $(shell pkg-config --libs glib-2.0)
Moritz Lipp's avatar
Moritz Lipp committed
24

Sebastian Ramacher's avatar
Sebastian Ramacher committed
25
26
27
DJVU_INC ?= $(shell pkg-config --cflags ddjvuapi)
DJVU_LIB ?= $(shell pkg-config --libs ddjvuapi)

28
29
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
30

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

Sebastian Ramacher's avatar
Sebastian Ramacher committed
37
38
INCS = ${GIRARA_INC} ${GLIB_INC} ${DJVU_INC} ${CAIRO_INC} ${ZATHURA_INC}
LIBS = ${GIRARA_LIB} ${GLIB_LIB} ${DJVU_LIB} ${CAIRO_LIB}
Moritz Lipp's avatar
Moritz Lipp committed
39

Sebastian Ramacher's avatar
Sebastian Ramacher committed
40
41
42
43
# pre-processor flags
CPPFLAGS += -D_FILE_OFFSET_BITS=64

# compiler flags
Sebastian Ramacher's avatar
Sebastian Ramacher committed
44
CFLAGS += -std=c11 -fPIC -pedantic -Wall -Wno-format-zero-length -Wextra $(INCS)
Moritz Lipp's avatar
Moritz Lipp committed
45

Sebastian Ramacher's avatar
Sebastian Ramacher committed
46
47
48
# linker flags
LDFLAGS += -fPIC

Moritz Lipp's avatar
Moritz Lipp committed
49
# debug
Sebastian Ramacher's avatar
Sebastian Ramacher committed
50
51
DFLAGS ?= -g

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

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