aboutsummaryrefslogtreecommitdiff
path: root/unix/Makefile
diff options
context:
space:
mode:
authorJohn R. Lenton2014-01-13 13:25:10 +0000
committerJohn R. Lenton2014-01-13 13:25:10 +0000
commit95499193497ce1fd15de217f7b69fc2f91a37dbf (patch)
treeba72dacaf09f8063a166217859cbfeaf530c58e7 /unix/Makefile
parenta23a24f89c4b7e05d269aafb54a3d539dd1caa03 (diff)
made DEBUG control CFLAGS in Makefiles oter than stm as well.
Diffstat (limited to 'unix/Makefile')
-rw-r--r--unix/Makefile11
1 files changed, 10 insertions, 1 deletions
diff --git a/unix/Makefile b/unix/Makefile
index e9bae4768..2c54cf2d4 100644
--- a/unix/Makefile
+++ b/unix/Makefile
@@ -11,9 +11,16 @@ ECHO = @echo
# compiler settings
CC = gcc
-CFLAGS = -I. -I$(PY_SRC) -Wall -Werror -ansi -std=gnu99 -Os #-DNDEBUG
+CFLAGS = -I. -I$(PY_SRC) -Wall -Werror -ansi -std=gnu99
LDFLAGS = -lm
+#Debugging/Optimization
+ifdef DEBUG
+CFLAGS += -Og -ggdb
+else
+CFLAGS += -Os #-DNDEBUG
+endif
+
# source files
SRC_C = \
main.c \
@@ -27,7 +34,9 @@ LIB = -lreadline
$(PROG): $(BUILD) $(OBJ)
$(ECHO) "LINK $<"
$(Q)$(CC) -o $@ $(OBJ) $(LIB) $(LDFLAGS)
+ifndef DEBUG
$(Q)strip $(PROG)
+endif
$(Q)size $(PROG)
$(BUILD)/%.o: %.c