config.mk 1.11 KB
Newer Older
Marek Vavruša's avatar
Marek Vavruša committed
1
# Project
Tomas Krizek's avatar
Tomas Krizek committed
2
MAJOR := 3
Tomas Krizek's avatar
Tomas Krizek committed
3
MINOR := 2
Tomas Krizek's avatar
Tomas Krizek committed
4
PATCH := 1
5
EXTRA ?=
Tomas Krizek's avatar
Tomas Krizek committed
6
ABIVER := 9
7
BUILDMODE := dynamic
8
HARDENING := yes
Marek Vavruša's avatar
Marek Vavruša committed
9

10
VERSION := $(MAJOR).$(MINOR).$(PATCH)$(EXTRA)
11

Marek Vavruša's avatar
Marek Vavruša committed
12
# Paths
13 14 15 16
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
SBINDIR ?= $(PREFIX)/sbin
LIBDIR ?= $(PREFIX)/lib
17 18
PKGCONFIGDIR ?= $(LIBDIR)/pkgconfig
MANDIR ?= $(PREFIX)/share/man
19 20
INCLUDEDIR ?= $(PREFIX)/include
MODULEDIR ?= $(LIBDIR)/kdns_modules
21
ETCDIR ?= $(PREFIX)/etc/knot-resolver
22
ROOTHINTS ?= $(ETCDIR)/root.hints
23
COVERAGE_STAGE ?= gcov
24 25
COVERAGE_STATSDIR ?= $(CURDIR)/coverage.stats
TOPSRCDIR := $(CURDIR)
26
KEYFILE_DEFAULT ?=
Marek Vavruša's avatar
Marek Vavruša committed
27 28

# Tools
29 30
CC      ?= cc
RM      := rm -f
31
LN      := ln -s
32
XXD_LUA := ./scripts/embed-lua.sh
Marek Vavruša's avatar
Marek Vavruša committed
33
INSTALL := install
34 35

# Flags
36
BUILD_LDFLAGS += $(LDFLAGS)
37 38
BUILD_CFLAGS := -std=c99 -D_GNU_SOURCE $(CFLAGS) $(CPPFLAGS)
BUILD_CFLAGS += -Wtype-limits -Wformat -Wformat-security -Wshadow -Wall
Vladimír Čunát's avatar
Vladimír Čunát committed
39
BUILD_CFLAGS += -I$(abspath .) -I$(abspath lib/generic) -I$(abspath contrib)
40
BUILD_CFLAGS += -DPACKAGE_VERSION="\"$(VERSION)\"" -DPREFIX="\"$(PREFIX)\"" -DMODULEDIR="\"$(MODULEDIR)\""
41
BUILD_CFLAGS += -fvisibility=hidden
42

43 44
ifeq (,$(findstring -O,$(CFLAGS)))
	BUILD_CFLAGS += -O2
45
endif