diff --git a/src/Makefile b/src/Makefile index 80e86fe..02b5690 100644 --- a/src/Makefile +++ b/src/Makefile @@ -9,8 +9,10 @@ endif BUILDDATE := `date +"%Y%m%d"` -CFLAGS += -Wall -Wextra -Wno-char-subscripts\ - -O2 -std=gnu99 -g3 -DBUILDDATE=\"$(BUILDDATE)\"\ +OPT_FLAGS ?= -O2 + +CFLAGS += -Wall -Wextra -Werror -Wno-char-subscripts\ + $(OPT_FLAGS) -std=gnu99 -g3 -DBUILDDATE=\"$(BUILDDATE)\"\ -I. -Iinclude -Iplatforms/common -I$(PLATFORM_DIR) \ -DVERSION_SUFFIX=\"`../scripts/setlocalversion`\" -MD diff --git a/src/platforms/stlink/Makefile.inc b/src/platforms/stlink/Makefile.inc index 40635cf..689c11e 100644 --- a/src/platforms/stlink/Makefile.inc +++ b/src/platforms/stlink/Makefile.inc @@ -2,6 +2,7 @@ CROSS_COMPILE ?= arm-none-eabi- CC = $(CROSS_COMPILE)gcc OBJCOPY = $(CROSS_COMPILE)objcopy +OPT_FLAGS = -Os CFLAGS += -mcpu=cortex-m3 -mthumb \ -DSTM32F1 -DDISCOVERY_STLINK -I../libopencm3/include \ -I platforms/stm32