Skip to content

Commit 0516c2e

Browse files
committed
CFLAGS clean up
1 parent 487871d commit 0516c2e

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

Makefile

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,30 @@ INC_PATHS = $(addprefix -I,$(IPATH))
207207
# - Additional compiler flags
208208
#******************************************************************************
209209

210+
# Debugging/Optimization
211+
ifeq ($(DEBUG), 1)
212+
CFLAGS += -Og -ggdb
213+
else
214+
CFLAGS += -Os
215+
endif
216+
210217
#flags common to all targets
211-
CFLAGS += -mcpu=cortex-m4
212-
CFLAGS += -mthumb -mabi=aapcs --std=gnu99
213-
CFLAGS += -Wall -Werror -Os -g3
214-
CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
215-
216-
# keep every function in separate section. This will allow linker to dump unused functions
217-
CFLAGS += -ffunction-sections -fdata-sections -fno-strict-aliasing
218-
CFLAGS += -fno-builtin -fshort-enums -fstack-usage
218+
CFLAGS += \
219+
-mthumb \
220+
-mabi=aapcs \
221+
-mcpu=cortex-m4 \
222+
-mfloat-abi=hard \
223+
-mfpu=fpv4-sp-d16 \
224+
-ffunction-sections \
225+
-fdata-sections \
226+
-fno-builtin \
227+
-fshort-enums \
228+
-fstack-usage \
229+
-fno-strict-aliasing \
230+
-Wall \
231+
-Werror
232+
233+
CFLAGS += -Wno-error=unused-parameter
219234

220235
# Defined Symbol (MACROS)
221236
CFLAGS += -D__HEAP_SIZE=0

0 commit comments

Comments
 (0)