File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,10 +24,20 @@ SIZE = $(COMPILER_PATH)/arm-none-eabi-size
2424
2525CFLAGS_TEENSY = -DF_CPU=96000000 -DUSB_SERIAL -D__MK20DX256__
2626CFLAGS_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
2828LDFLAGS = -nostdlib -T mk20dx256.ld
2929LIBS = -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+
3141SRC_C = \
3242 main.c \
3343 lcd.c \
Original file line number Diff line number Diff line change @@ -11,9 +11,16 @@ ECHO = @echo
1111
1212# compiler settings
1313CC = 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
1515LDFLAGS = -lm
1616
17+ # Debugging/Optimization
18+ ifdef DEBUG
19+ CFLAGS += -Og -ggdb
20+ else
21+ CFLAGS += -Os # -DNDEBUG
22+ endif
23+
1724# source files
1825SRC_C = \
1926 main.c \
Original file line number Diff line number Diff line change @@ -11,9 +11,16 @@ ECHO = @echo
1111
1212# compiler settings
1313CC = 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
1515LDFLAGS = -lm
1616
17+ # Debugging/Optimization
18+ ifdef DEBUG
19+ CFLAGS += -Og -ggdb
20+ else
21+ CFLAGS += -Os # -DNDEBUG
22+ endif
23+
1724# source files
1825SRC_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
You can’t perform that action at this time.
0 commit comments