From a9a0920f431c76f31157edd42c6d055b673ed12f Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Mon, 2 Jun 2025 12:55:39 -0400 Subject: pkfuncinstr.h: created, first-pass --- config.mk | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'config.mk') 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 -- cgit v1.2.3