summaryrefslogtreecommitdiffstats
path: root/config.mk
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--config.mk45
1 files changed, 45 insertions, 0 deletions
diff --git a/config.mk b/config.mk
new file mode 100644
index 0000000..7a652c9
--- /dev/null
+++ b/config.mk
@@ -0,0 +1,45 @@
+# Project
+MAJOR := 3
+MINOR := 2
+PATCH := 1
+EXTRA ?=
+ABIVER := 9
+BUILDMODE := dynamic
+HARDENING := yes
+
+VERSION := $(MAJOR).$(MINOR).$(PATCH)$(EXTRA)
+
+# Paths
+PREFIX ?= /usr/local
+BINDIR ?= $(PREFIX)/bin
+SBINDIR ?= $(PREFIX)/sbin
+LIBDIR ?= $(PREFIX)/lib
+PKGCONFIGDIR ?= $(LIBDIR)/pkgconfig
+MANDIR ?= $(PREFIX)/share/man
+INCLUDEDIR ?= $(PREFIX)/include
+MODULEDIR ?= $(LIBDIR)/kdns_modules
+ETCDIR ?= $(PREFIX)/etc/knot-resolver
+ROOTHINTS ?= $(ETCDIR)/root.hints
+COVERAGE_STAGE ?= gcov
+COVERAGE_STATSDIR ?= $(CURDIR)/coverage.stats
+TOPSRCDIR := $(CURDIR)
+KEYFILE_DEFAULT ?=
+
+# Tools
+CC ?= cc
+RM := rm -f
+LN := ln -s
+XXD_LUA := ./scripts/embed-lua.sh
+INSTALL := install
+
+# Flags
+BUILD_LDFLAGS += $(LDFLAGS)
+BUILD_CFLAGS := -std=c99 -D_GNU_SOURCE $(CFLAGS) $(CPPFLAGS)
+BUILD_CFLAGS += -Wtype-limits -Wformat -Wformat-security -Wshadow -Wall
+BUILD_CFLAGS += -I$(abspath .) -I$(abspath lib/generic) -I$(abspath contrib)
+BUILD_CFLAGS += -DPACKAGE_VERSION="\"$(VERSION)\"" -DPREFIX="\"$(PREFIX)\"" -DMODULEDIR="\"$(MODULEDIR)\""
+BUILD_CFLAGS += -fvisibility=hidden
+
+ifeq (,$(findstring -O,$(CFLAGS)))
+ BUILD_CFLAGS += -O2
+endif