Merge branch 'master' of https://github.com/texane/stlink
[fw/stlink] / example / 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 # stm32l_discovery lib
11 CFLAGS+=-I../libstm32l_discovery/inc
12 CFLAGS+=-I../libstm32l_discovery/inc/base
13 CFLAGS+=-I../libstm32l_discovery/inc/core_support
14 CFLAGS+=-I../libstm32l_discovery/inc/device_support
15
16 # to run from SRAM
17 CFLAGS+=-Wl,-T,linker_stm32l.lds
18
19 SRCS=\
20 main.c\
21 stm32l_discovery_lcd.c
22
23 OBJS=$(SRCS:.c=.o)
24
25 all: $(ELF)
26
27 $(ELF): $(OBJS)
28         $(CC) $(CFLAGS) -o $@ $(OBJS) -L../libstm32l_discovery/build -lstm32l_discovery
29
30 %.o: %.c
31         $(CC) $(CFLAGS) -c -o $@ $^
32
33 clean:
34         -rm -f $(OBJS)
35         -rm -f $(ELF)
36
37 .PHONY: all clean