Only call strtoul when there is an argument that strtoul can work on
[fw/stlink] / example / 32l_lcd / Makefile
1 ELF=lcd.elf
2
3 CC=arm-none-eabi-gcc
4
5 CFLAGS=-O2 -mlittle-endian -mthumb -g
6 CFLAGS+=-mcpu=cortex-m3 -ffreestanding -nostdlib -nostdinc
7
8 CFLAGS+=-I.
9
10
11 PLATFORM=stm32l1xx
12 LIBS_STM_PATH=../libs_stm
13
14 CFLAGS+=-I$(LIBS_STM_PATH)/inc/base
15 CFLAGS+=-I$(LIBS_STM_PATH)/inc/core_support
16 CFLAGS+=-I$(LIBS_STM_PATH)/inc/device_support
17 CFLAGS+=-I$(LIBS_STM_PATH)/inc/$(PLATFORM)
18
19 # to run from SRAM
20 CFLAGS+=-Wl,-T,linker_stm32l.lds
21
22 LDFLAGS+=-L$(LIBS_STM_PATH)/build -lstm32_stdperiph_l1xx
23
24 SRCS=\
25 main.c\
26 stm32l_discovery_lcd.c
27
28 OBJS=$(SRCS:.c=.o)
29
30 all: $(ELF)
31
32 $(ELF): $(OBJS)
33         $(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS)
34
35 %.o: %.c
36         $(CC) $(CFLAGS) -c -o $@ $^
37
38 clean:
39         -rm -f $(OBJS)
40         -rm -f $(ELF)
41
42 .PHONY: all clean