diff options
author | Ian Moffett <ian@osmora.org> | 2025-03-28 02:02:54 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-03-28 02:04:44 -0400 |
commit | de8dbdf8a432c31998fd523fa15c768d4ff67c91 (patch) | |
tree | da224ca3727086b627b6807a489972e4a4639e87 | |
parent | 833f064b8f4ee30b9f46bba654a99411cd6866d3 (diff) |
build: Add DIAG=[yes/no] build parametermain
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | lib/libostp/session.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,7 +1,12 @@ +DIAG=yes CFILES_OTLIB = $(shell find lib/ -name "*.c") CFLAGS_OTLIB = -pedantic -Ilib/include/ -fPIC OTLIB_OBJ = $(CFILES_OTLIB:.c=.o) +ifeq ($(DIAG),yes) +CFLAGS_OTLIB += -D_DIAGNOSTIC +endif + libostp.so: $(OTLIB_OBJ) $(CC) -shared -o $@ $(OTLIB_OBJ) diff --git a/lib/libostp/session.c b/lib/libostp/session.c index 3843207..b47948e 100644 --- a/lib/libostp/session.c +++ b/lib/libostp/session.c @@ -42,7 +42,7 @@ #include <string.h> #include <unistd.h> -#if DIAGNOSTIC +#ifdef _DIAGNOSTIC #define LOG(fmt, ...) printf(fmt, ##__VA_ARGS__) #else #define LOG(...) (void)0 |