1 # build an elf from the an3268 demonstration code
5 OBJCOPY=arm-none-eabi-objcopy
7 CFLAGS=-O2 -mlittle-endian -mthumb
8 CFLAGS+=-mcpu=cortex-m3 -ffreestanding -nostdlib -nostdinc
14 CFLAGS+=-Wl,-Ttext,0x20000000 -Wl,-e,0x20000000
16 # to write to flash then run
17 # CFLAGS+=-Wl,-Ttext,0x08000000 -Wl,-e,0x08000000
20 BOARD_SUPPORT=../board_support/discovery_32vl
21 LIBS_STM_PATH=../libs_stm
24 CFLAGS+=-I$(LIBS_STM_PATH)/inc/base
25 CFLAGS+=-I$(LIBS_STM_PATH)/inc/core_support
26 CFLAGS+=-I$(LIBS_STM_PATH)/inc/device_support
27 CFLAGS+=-I$(LIBS_STM_PATH)/inc/$(PLATFORM)
28 CFLAGS+=-I$(BOARD_SUPPORT)
30 LDFLAGS+=-L$(LIBS_STM_PATH)/build -lstm32_stdperiph_f10x
34 SRCS+=$(wildcard $(BOARD_SUPPORT)/*.c)
41 $(OBJCOPY) -O binary $^ $@
44 $(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS)
47 $(CC) $(CFLAGS) -c -o $@ $^