COMPILER=clang

/* to see which target clang supports:
   sudo update-alternatives --install /usr/bin/llc llc /usr/lib/llvm-3.9/bin/llc 20
   llc -march=arm -mattr=help */

TARGET = embox

ARCH = arm

CHIP_VENDOR = stm32
PLATFORM_VENDOR = stm32
PLATFORM = stm32f4_discovery

CROSS_COMPILE = arm-none-eabi-

CFLAGS += -DSTM32F407xx

CFLAGS += -O0 -g
ifeq ($(COMPILER),clang)
CFLAGS += -target armv7e-m---  -mlittle-endian -mtune=cortex-m4 -msoft-float \
	-ffreestanding
else
CFLAGS += -mthumb -mlittle-endian -march=armv7e-m -mtune=cortex-m4 -msoft-float \
	-ffreestanding
endif


/* happens in stm32_flash_cube.c */
override CFLAGS += -Wno-unused-const-variable
/* in ping.c */
override CFLAGS += -Wno-gnu-variable-sized-type-not-at-end
/* icmpv4.c */
override CFLAGS += -Wno-varargs
/* src/drivers/tty/serial/ttys_processing.c and maybe many others */
override CFLAGS += -Wno-unused-function
/* src/lib/crypt/b64.c */
override CFLAGS += -Wno-tautological-constant-out-of-range-compare
/* build/extbld/third_party/bsp/stmf4cube/core/STM32Cube_FW_F4_V1.13.0/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c */
override CFLAGS += -Wno-parentheses-equality
