Skip to content

Commit c6920d3

Browse files
committed
Merge pull request adafruit#170 from chipaca/master
made DEBUG control CFLAGS in Makefiles other than stm as well.
2 parents 0367ad6 + 10d2f72 commit c6920d3

3 files changed

Lines changed: 29 additions & 3 deletions

File tree

teensy/Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,20 @@ SIZE = $(COMPILER_PATH)/arm-none-eabi-size
2424

2525
CFLAGS_TEENSY = -DF_CPU=96000000 -DUSB_SERIAL -D__MK20DX256__
2626
CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mcpu=cortex-m4 -fsingle-precision-constant -Wdouble-promotion $(CFLAGS_TEENSY)
27-
CFLAGS = -I. -I$(PY_SRC) -I$(CORE_PATH) -Wall -ansi -std=gnu99 -Os -DNDEBUG $(CFLAGS_CORTEX_M4) -D$(TARGET)
27+
CFLAGS = -I. -I$(PY_SRC) -I$(CORE_PATH) -Wall -ansi -std=gnu99
2828
LDFLAGS = -nostdlib -T mk20dx256.ld
2929
LIBS = -L $(COMPILER_PATH)/../lib/gcc/arm-none-eabi/4.7.2/thumb2 -lgcc
3030

31+
#Debugging/Optimization
32+
ifdef DEBUG
33+
CFLAGS += -Og -ggdb
34+
else
35+
CFLAGS += -Os #-DNDEBUG
36+
endif
37+
38+
# if order is not important for these, move them up
39+
CFLAGS += $(CFLAGS_CORTEX_M4) -D$(TARGET)
40+
3141
SRC_C = \
3242
main.c \
3343
lcd.c \

unix-cpy/Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,16 @@ ECHO = @echo
1111

1212
# compiler settings
1313
CC = gcc
14-
CFLAGS = -I. -I$(PY_SRC) -Wall -Werror -ansi -std=gnu99 -Os #-DNDEBUG
14+
CFLAGS = -I. -I$(PY_SRC) -Wall -Werror -ansi -std=gnu99
1515
LDFLAGS = -lm
1616

17+
#Debugging/Optimization
18+
ifdef DEBUG
19+
CFLAGS += -Og -ggdb
20+
else
21+
CFLAGS += -Os #-DNDEBUG
22+
endif
23+
1724
# source files
1825
SRC_C = \
1926
main.c \

unix/Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,16 @@ ECHO = @echo
1111

1212
# compiler settings
1313
CC = gcc
14-
CFLAGS = -I. -I$(PY_SRC) -Wall -Werror -ansi -std=gnu99 -Os #-DNDEBUG
14+
CFLAGS = -I. -I$(PY_SRC) -Wall -Werror -ansi -std=gnu99
1515
LDFLAGS = -lm
1616

17+
#Debugging/Optimization
18+
ifdef DEBUG
19+
CFLAGS += -Og -ggdb
20+
else
21+
CFLAGS += -Os #-DNDEBUG
22+
endif
23+
1724
# source files
1825
SRC_C = \
1926
main.c \
@@ -27,7 +34,9 @@ LIB = -lreadline
2734
$(PROG): $(BUILD) $(OBJ)
2835
$(ECHO) "LINK $<"
2936
$(Q)$(CC) -o $@ $(OBJ) $(LIB) $(LDFLAGS)
37+
ifndef DEBUG
3038
$(Q)strip $(PROG)
39+
endif
3140
$(Q)size $(PROG)
3241

3342
$(BUILD)/%.o: %.c

0 commit comments

Comments
 (0)