From 95499193497ce1fd15de217f7b69fc2f91a37dbf Mon Sep 17 00:00:00 2001 From: John R. Lenton Date: Mon, 13 Jan 2014 13:25:10 +0000 Subject: made DEBUG control CFLAGS in Makefiles oter than stm as well. --- unix/Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'unix') 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 -- cgit v1.2.3