- Added automatic debug flags to CFLAGS if DEBUG is set in shell
diff --git a/library/Makefile b/library/Makefile
index 0b86828..2a860ce 100644
--- a/library/Makefile
+++ b/library/Makefile
@@ -4,6 +4,10 @@
CFLAGS += -I../include -D_FILE_OFFSET_BITS=64 -Wall -W -Wdeclaration-after-statement
OFLAGS = -O
+ifdef DEBUG
+CFLAGS += -g3
+endif
+
# MicroBlaze specific options:
# CFLAGS += -mno-xl-soft-mul -mxl-barrel-shift
@@ -65,7 +69,7 @@
$(CC) -shared -Wl,-soname,$@ -o $@ $(OBJS) -lws2_32 -lwinmm -lgdi32
.c.o:
- echo " CC $<"
+ echo " CC $< $(CFLAGS)"
$(CC) $(CFLAGS) $(OFLAGS) -c $<
clean:
diff --git a/programs/Makefile b/programs/Makefile
index 7027743..e6771ce 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -7,6 +7,10 @@
OFLAGS = -O
LDFLAGS += -L../library -lpolarssl $(SYS_LDFLAGS)
+ifdef DEBUG
+CFLAGS += -g3
+endif
+
APPS = aes/aescrypt2 aes/crypt_and_hash \
hash/hello hash/generic_sum \
hash/md5sum hash/sha1sum \
diff --git a/tests/Makefile b/tests/Makefile
index 3d2c1bf..a44d8dc 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -9,6 +9,10 @@
OFLAGS = -O
LDFLAGS += -L../library -lpolarssl $(SYS_LDFLAGS)
+ifdef DEBUG
+CFLAGS += -g3
+endif
+
APPS = test_suite_aes test_suite_arc4 \
test_suite_base64 test_suite_camellia \
test_suite_cipher.aes test_suite_cipher.camellia \