config.mk 1.03 KB
Newer Older
Marek Vavruša's avatar
Marek Vavruša committed
1
# Project
2
MAJOR := 1
Vladimír Čunát's avatar
Vladimír Čunát committed
3
MINOR := 3
Vladimír Čunát's avatar
Vladimír Čunát committed
4
PATCH := 3
Vladimír Čunát's avatar
Vladimír Čunát committed
5
EXTRA :=
6
ABIVER := 4
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 21
INCLUDEDIR ?= $(PREFIX)/include
MODULEDIR ?= $(LIBDIR)/kdns_modules
ETCDIR ?= $(PREFIX)/etc/kresd
22
ROOTHINTS ?= $(ETCDIR)/hints.zone
Marek Vavruša's avatar
Marek Vavruša committed
23 24

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

# Flags
32
BUILD_LDFLAGS += $(LDFLAGS)
33
BUILD_CFLAGS := $(CFLAGS) -std=c99 -D_GNU_SOURCE -Wno-unused -Wtype-limits -Wformat -Wformat-security -Wall -I$(abspath .) -I$(abspath lib/generic) -I$(abspath contrib) -I$(abspath contrib/lmdb)
34
BUILD_CFLAGS += -DPACKAGE_VERSION="\"$(VERSION)\"" -DPREFIX="\"$(PREFIX)\"" -DMODULEDIR="\"$(MODULEDIR)\""
35 36
ifeq (,$(findstring -O,$(CFLAGS)))
	BUILD_CFLAGS += -O2
37 38 39
endif
ifeq (,$(findstring -fsanitize=address,$(CFLAGS)))
	BUILD_CFLAGS += -D_FORTIFY_SOURCE=2
40
endif