Rename 32L specific examples
[fw/stlink] / example / 32l_lcd / Makefile
diff --git a/example/32l_lcd/Makefile b/example/32l_lcd/Makefile
new file mode 100644 (file)
index 0000000..fce2194
--- /dev/null
@@ -0,0 +1,42 @@
+ELF=lcd.elf
+
+CC=arm-none-eabi-gcc
+
+CFLAGS=-O2 -mlittle-endian -mthumb -g
+CFLAGS+=-mcpu=cortex-m3 -ffreestanding -nostdlib -nostdinc
+
+CFLAGS+=-I.
+
+
+PLATFORM=stm32l1xx
+LIBS_STM_PATH=../libs_stm
+
+CFLAGS+=-I$(LIBS_STM_PATH)/inc/base
+CFLAGS+=-I$(LIBS_STM_PATH)/inc/core_support
+CFLAGS+=-I$(LIBS_STM_PATH)/inc/device_support
+CFLAGS+=-I$(LIBS_STM_PATH)/inc/$(PLATFORM)
+
+# to run from SRAM
+CFLAGS+=-Wl,-T,linker_stm32l.lds
+
+LDFLAGS+=-L$(LIBS_STM_PATH)/build -lstm32l_discovery
+
+SRCS=\
+main.c\
+stm32l_discovery_lcd.c
+
+OBJS=$(SRCS:.c=.o)
+
+all: $(ELF)
+
+$(ELF): $(OBJS)
+       $(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS)
+
+%.o: %.c
+       $(CC) $(CFLAGS) -c -o $@ $^
+
+clean:
+       -rm -f $(OBJS)
+       -rm -f $(ELF)
+
+.PHONY: all clean