summaryrefslogtreecommitdiff
path: root/config.mk
diff options
context:
space:
mode:
Diffstat (limited to 'config.mk')
-rw-r--r--config.mk29
1 files changed, 21 insertions, 8 deletions
diff --git a/config.mk b/config.mk
index 09cce6a..914d59d 100644
--- a/config.mk
+++ b/config.mk
@@ -7,22 +7,35 @@ MANPREFIX = $(PREFIX)/share/man
PKG_CONFIG = pkg-config
+# compiler and linker
+CC ?= /usr/bin/gcc
+CXX ?= /usr/bin/g++
+
# includes and libs
INCS = \
+# dl is for pkfuncinstr
LIBS = -lm \
+ -ldl \
# flags
-# -pedantic
+# -rdynamic is for pkfuncinstr
SHARED_FLAGS = -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L \
- -DVERSION=\"$(VERSION)\" -DPK_MEMORY_DEBUGGER -DPK_IMPL_ALL \
+ -DVERSION=\"$(VERSION)\" \
+ -DPK_MEMORY_DEBUGGER \
+ -pedantic \
+ -rdynamic \
-CFLAGS += -Wall -Wextra -pedantic $(INCS) $(SHARED_FLAGS)
-CXXFLAGS += -Wall -Wextra -pedantic $(INCS) $(SHARED_FLAGS)
+CFLAGS += -Wall -Wextra $(INCS) $(SHARED_FLAGS)
+CXXFLAGS += -Wall -Wextra $(INCS) $(SHARED_FLAGS)
LDFLAGS = $(LIBS)
-OPTLEVEL ?= -O3
+# -finstrument-functions is for pkfuncinstr
+ifeq ($(CC),/usr/bin/gcc)
+ CFLAGS += -finstrument-functions
+endif
+ifeq ($(CXX),/usr/bin/g++)
+ CXXFLAGS += -finstrument-functions
+endif
-# compiler and linker
-CC ?= /usr/bin/gcc
-CXX ?= /usr/bin/g++
+OPTLEVEL ?= -O3