config.mk 1022 Bytes
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 := 1
Vladimír Čunát's avatar
Vladimír Čunát committed
5
EXTRA :=
6
ABIVER := 3
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
Marek Vavruša's avatar
Marek Vavruša committed
22 23

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

# Flags
BUILD_LDFLAGS += $(LDFLAGS)
32
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)
33
BUILD_CFLAGS += -DPACKAGE_VERSION="\"$(VERSION)\"" -DPREFIX="\"$(PREFIX)\"" -DMODULEDIR="\"$(MODULEDIR)\""
34 35
ifeq (,$(findstring -O,$(CFLAGS)))
	BUILD_CFLAGS += -O2
36 37 38
endif
ifeq (,$(findstring -fsanitize=address,$(CFLAGS)))
	BUILD_CFLAGS += -D_FORTIFY_SOURCE=2
39
endif