CFLAGS clean up

This commit is contained in:
hathach 2020-03-25 00:04:28 +07:00
parent 487871db8e
commit 0516c2e247

View File

@ -207,15 +207,30 @@ INC_PATHS = $(addprefix -I,$(IPATH))
# - Additional compiler flags # - Additional compiler flags
#****************************************************************************** #******************************************************************************
#flags common to all targets # Debugging/Optimization
CFLAGS += -mcpu=cortex-m4 ifeq ($(DEBUG), 1)
CFLAGS += -mthumb -mabi=aapcs --std=gnu99 CFLAGS += -Og -ggdb
CFLAGS += -Wall -Werror -Os -g3 else
CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 CFLAGS += -Os
endif
# keep every function in separate section. This will allow linker to dump unused functions #flags common to all targets
CFLAGS += -ffunction-sections -fdata-sections -fno-strict-aliasing CFLAGS += \
CFLAGS += -fno-builtin -fshort-enums -fstack-usage -mthumb \
-mabi=aapcs \
-mcpu=cortex-m4 \
-mfloat-abi=hard \
-mfpu=fpv4-sp-d16 \
-ffunction-sections \
-fdata-sections \
-fno-builtin \
-fshort-enums \
-fstack-usage \
-fno-strict-aliasing \
-Wall \
-Werror
CFLAGS += -Wno-error=unused-parameter
# Defined Symbol (MACROS) # Defined Symbol (MACROS)
CFLAGS += -D__HEAP_SIZE=0 CFLAGS += -D__HEAP_SIZE=0