config.mk 927 Bytes
Newer Older
Marek Vavruša's avatar
Marek Vavruša committed
1
# Project
2
MAJOR := 1
3
MINOR := 1
4
PATCH := 0
5 6
ABIVER := 1
BUILDMODE := dynamic
7
HARDENING := yes
Marek Vavruša's avatar
Marek Vavruša committed
8 9

# Paths
10 11 12 13 14 15 16
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
SBINDIR ?= $(PREFIX)/sbin
LIBDIR ?= $(PREFIX)/lib
INCLUDEDIR ?= $(PREFIX)/include
MODULEDIR ?= $(LIBDIR)/kdns_modules
ETCDIR ?= $(PREFIX)/etc/kresd
Marek Vavruša's avatar
Marek Vavruša committed
17 18

# Tools
19
CC	?= cc
Marek Vavruša's avatar
Marek Vavruša committed
20
RM	:= rm -f
21
LN      := ln -s
22
XXD     := ./scripts/embed.sh
Marek Vavruša's avatar
Marek Vavruša committed
23
INSTALL := install
24 25 26

# Flags
BUILD_LDFLAGS += $(LDFLAGS)
27
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)
28
BUILD_CFLAGS += -DPACKAGE_VERSION="\"$(MAJOR).$(MINOR).$(PATCH)\"" -DPREFIX="\"$(PREFIX)\"" -DMODULEDIR="\"$(MODULEDIR)\"" -DETCDIR="\"$(ETCDIR)\""
29 30
ifeq (,$(findstring -O,$(CFLAGS)))
	BUILD_CFLAGS += -O2
31 32 33
endif
ifeq (,$(findstring -fsanitize=address,$(CFLAGS)))
	BUILD_CFLAGS += -D_FORTIFY_SOURCE=2
34
endif