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

3
GIRARA_VERSION_MAJOR = 0
Moritz Lipp's avatar
Moritz Lipp committed
4
GIRARA_VERSION_MINOR = 2
Sebastian Ramacher's avatar
Sebastian Ramacher committed
5
GIRARA_VERSION_REV   = 8
6
VERSION = ${GIRARA_VERSION_MAJOR}.${GIRARA_VERSION_MINOR}.${GIRARA_VERSION_REV}
Moritz Lipp's avatar
Moritz Lipp committed
7

8
# Rules for the SOMAJOR and SOMINOR.
Sebastian Ramacher's avatar
Sebastian Ramacher committed
9
# Before a release perform the following checks against the last release:
10 11 12
# * If a function has been removed or the paramaters of a function have changed
#   bump SOMAJOR and set SOMINOR to 0.
# * If any of the exported datastructures have changed in a incompatible way
Sebastian Ramacher's avatar
Sebastian Ramacher committed
13
#   bump SOMAJOR and set SOMINOR to 0.
14
# * If a function has been added bump SOMINOR.
Sebastian Ramacher's avatar
Sebastian Ramacher committed
15
SOMAJOR = 3
16
SOMINOR = 0
Sebastian Ramacher's avatar
Sebastian Ramacher committed
17
SOVERSION = ${SOMAJOR}.${SOMINOR}
Moritz Lipp's avatar
Moritz Lipp committed
18

19 20 21
# pkg-config binary
PKG_CONFIG ?= pkg-config

22 23 24
# glib-compile-resource binary
GLIB_COMPILE_RESOURCES ?= glib-compile-resources

25
# libnotify
26
WITH_LIBNOTIFY ?= $(shell (${PKG_CONFIG} libnotify --atleast-version=0.7.0 && echo 1) || echo 0)
27

28
# libjson-c
29
WITH_JSON ?= $(shell (${PKG_CONFIG} json-c --exists && echo 1) || echo 0)
30

Moritz Lipp's avatar
Moritz Lipp committed
31 32
# paths
PREFIX ?= /usr
33 34
LIBDIR ?= ${PREFIX}/lib
INCLUDEDIR ?= ${PREFIX}/include
Moritz Lipp's avatar
Moritz Lipp committed
35

36 37
# locale directory
LOCALEDIR ?= ${PREFIX}/share/locale
Moritz Lipp's avatar
Moritz Lipp committed
38

39 40 41 42 43 44 45 46
# build directories
DEPENDDIR ?= .depend
BUILDDIR ?= build
BUILDDIR_RELEASE ?= ${BUILDDIR}/release
BUILDDIR_DEBUG ?= ${BUILDDIR}/debug
BUILDDIR_GCOV ?= ${BUILDDIR}/gcov
BINDIR ?= bin

47 48 49 50 51
# version checks
# If you want to disable any of the checks, set *_VERSION_CHECK to 0.

# GTK+
GTK_VERSION_CHECK ?= 1
Sebastian Ramacher's avatar
Sebastian Ramacher committed
52
GTK_MIN_VERSION = 3.20
53
GTK_PKG_CONFIG_NAME = gtk+-3.0
54 55
# glib
GLIB_VERSION_CHECK ?= 1
56
GLIB_MIN_VERSION = 2.50
57
GLIB_PKG_CONFIG_NAME = glib-2.0
58

Moritz Lipp's avatar
Moritz Lipp committed
59
# libs
60 61 62 63 64 65
ifeq (${GTK_INC}-${GTK_LIB},-)
PKG_CONFIG_LIBS += gtk+-3.0
else
INCS += ${GTK_INC}
LIBS += ${GTK_LIB}
endif
Moritz Lipp's avatar
Moritz Lipp committed
66

67
ifneq (${WITH_LIBNOTIFY},0)
68 69 70 71 72 73
ifeq (${LIBNOTIFY_INC}-${LIBNOTIFY_LIB},-)
PKG_CONFIG_LIBS += libnotify
else
INCS += ${LIBNOTIFY_INC}
LIBS += ${LIBNOTIFY_LIB}
endif
74 75
endif

76
ifneq (${WITH_JSON},0)
77 78 79 80 81 82
ifeq (${JSON_INC}-${JSON_LIB},-)
PKG_CONFIG_LIBS += json-c
else
INCS += ${JSON_INC}
LIBS += ${JSON_LIB}
endif
83 84
endif

85 86 87 88 89
ifneq (${PKG_CONFIG_LIBS},)
INCS += $(shell ${PKG_CONFIG} --cflags ${PKG_CONFIG_LIBS})
LIBS += $(shell ${PKG_CONFIG} --libs ${PKG_CONFIG_LIBS})
endif
LIBS += -lm
Moritz Lipp's avatar
Moritz Lipp committed
90

91 92 93 94
# pre-processor flags
CPPFLAGS += -D_FILE_OFFSET_BITS=64

# compiler flags
Moritz Lipp's avatar
Moritz Lipp committed
95
CFLAGS += -std=c11 -pedantic -Wall -Wextra -fPIC $(INCS)
96 97 98

# linker flags
LDFLAGS += -fPIC
Moritz Lipp's avatar
Moritz Lipp committed
99 100

# debug
101
DFLAGS = -O0 -g
Moritz Lipp's avatar
Moritz Lipp committed
102 103 104 105

# compiler
CC ?= gcc

106 107 108
# archiver
AR ?= ar

Moritz Lipp's avatar
Moritz Lipp committed
109
# strip
110 111
SFLAGS ?= -s

112 113 114 115
# soname
SONAME_FLAG ?= -soname
SHARED_FLAG ?= -shared

116 117
# set to something != 0 if you want verbose build output
VERBOSE ?= 0
118 119

# gettext package name
Sebastian Ramacher's avatar
Sebastian Ramacher committed
120
GETTEXT_PACKAGE ?= lib${PROJECT}-${SOMAJOR}
121 122 123

# msgfmt
MSGFMT ?= msgfmt
Moritz Lipp's avatar
Moritz Lipp committed
124

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

Moritz Lipp's avatar
Moritz Lipp committed
135 136
# colors
COLOR ?= 1
Moritz Lipp's avatar
Moritz Lipp committed
137 138

# dist
139
TARFILE = ${PROJECTNV}-${VERSION}.tar.gz