summaryrefslogtreecommitdiffstatshomepage
path: root/unix/Makefile
diff options
context:
space:
mode:
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 9af86b9855..9055909fb4 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 -DUNIX #-DNDEBUG
+CFLAGS = -I. -I$(PY_SRC) -Wall -Werror -ansi -std=gnu99 -DUNIX
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