summaryrefslogtreecommitdiff
path: root/config.mk
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-06-02 12:55:39 -0400
committerJonathan Bradley <jcb@pikum.xyz>2025-06-03 13:55:33 -0400
commita9a0920f431c76f31157edd42c6d055b673ed12f (patch)
tree8884ae8cd6de5d896dfd54efe1539a33e6ce2b6e /config.mk
parent467dce9c254737e8437735471af887a544ef8d10 (diff)
pkfuncinstr.h: created, first-pass
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