From dc2311d87d05f557b66fca6a72f30d2d10faab14 Mon Sep 17 00:00:00 2001 From: flederwiesel Date: Mon, 11 Nov 2019 10:10:51 +0100 Subject: [PATCH] Compile with debug info and do not strip if DEBUG is set (not evaluating its value...). --- library/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/Makefile b/library/Makefile index 19396ee..2d703e6 100644 --- a/library/Makefile +++ b/library/Makefile @@ -27,7 +27,7 @@ CC?=$(CCARCH)gcc STRIP?=$(CCARCH)strip -CFLAGS=-fPIC -O3 -std=gnu99 -pedantic -Wall -Wextra -Wconversion -Werror -c -fmessage-length=0 -ffunction-sections -fdata-sections +CFLAGS=-fPIC $(if $(DEBUG),-O0 -g,-O3) -std=gnu99 -pedantic -Wall -Wextra -Wconversion -Werror -c -fmessage-length=0 -ffunction-sections -fdata-sections LDFLAGS=-shared ifeq ($(OS),Windows_NT) @@ -53,7 +53,7 @@ all: $(EXECUTABLE) $(EXECUTABLE): $(OBJECTS_OBJ) $(CC) $(LDFLAGS) $(OBJECTS_OBJ) -o $@ - $(STRIP) $@ + $(if $(DEBUG),,$(STRIP) $@) obj/%.o: src/%.c $(INCLUDES_SRC)