git » libfiu » commit 1f72079

libfiu: Do not build with -O3 for debug/profile builds

author Alberto Bertogli
2013-10-11 00:32:10 UTC
committer Alberto Bertogli
2013-10-29 02:11:50 UTC
parent 82621d9c4d483e05dc80e513dd365f7a94605737

libfiu: Do not build with -O3 for debug/profile builds

By default, we shouldn't use -O3 for debug/profile builds, as it can make the
debugging/profiling information much harder to follow.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

libfiu/Makefile +11 -6

diff --git a/libfiu/Makefile b/libfiu/Makefile
index 1288b8d..bd46690 100644
--- a/libfiu/Makefile
+++ b/libfiu/Makefile
@@ -1,13 +1,18 @@
 
-CFLAGS += -std=c99 -pedantic -Wall -O3
+CFLAGS += -std=c99 -pedantic -Wall
 ALL_CFLAGS = -D_XOPEN_SOURCE=600 -fPIC -DFIU_ENABLE=1 $(CFLAGS)
 
-ifdef DEBUG
-ALL_CFLAGS += -g
-endif
+# Optimization CFLAGS, only used when doing a non-debug build.
+OPT_CFLAGS = -O3
 
-ifdef PROFILE
-ALL_CFLAGS += -g -pg -fprofile-arcs -ftest-coverage
+ifdef DEBUG
+    ALL_CFLAGS += -g
+else
+   ifdef PROFILE
+        ALL_CFLAGS += -g -pg -fprofile-arcs -ftest-coverage
+   else
+       ALL_CFLAGS += $(OPT_CFLAGS)
+   endif
 endif