From 49569ccd6bc04e7b4bcdf974433f9201fc93a337 Mon Sep 17 00:00:00 2001 From: Fabien Le Mentec Date: Sun, 20 Nov 2011 15:54:00 -0600 Subject: [PATCH] [update] blink_flash makefile --- example/32l_dac/Makefile | 2 +- example/blink_flash/Makefile | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/example/32l_dac/Makefile b/example/32l_dac/Makefile index 87773ef..6c18441 100644 --- a/example/32l_dac/Makefile +++ b/example/32l_dac/Makefile @@ -28,7 +28,7 @@ $(BIN_IMAGE): $(EXECUTABLE) $(OBJCOPY) -O binary $^ $@ $(EXECUTABLE): main.c system_stm32l1xx.c startup_stm32l1xx_md.s - $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) + $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) clean: rm -rf $(EXECUTABLE) diff --git a/example/blink_flash/Makefile b/example/blink_flash/Makefile index 4611731..1696bf5 100644 --- a/example/blink_flash/Makefile +++ b/example/blink_flash/Makefile @@ -19,11 +19,16 @@ CFLAGS+=-ffreestanding -nostdlib -nostdinc # to run from FLASH CFLAGS+=-Wl,-T,stm32_flash.ld +PLATFORM=stm32l1xx +LIBS_STM_PATH=../libs_stm + # stm32l_discovery lib -CFLAGS+=-I../libstm32l_discovery/inc -CFLAGS+=-I../libstm32l_discovery/inc/base -CFLAGS+=-I../libstm32l_discovery/inc/core_support -CFLAGS+=-I../libstm32l_discovery/inc/device_support +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) + +LDFLAGS+=-L$(LIBS_STM_PATH)/build -lstm32_stdperiph_l1xx all: $(BIN_IMAGE) @@ -31,10 +36,13 @@ $(BIN_IMAGE): $(EXECUTABLE) $(OBJCOPY) -O binary $^ $@ $(EXECUTABLE): main.c system_stm32l1xx.c startup_stm32l1xx_md.s - $(CC) $(CFLAGS) $^ -o $@ -L../libstm32l_discovery/build -lstm32l_discovery + $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) clean: rm -rf $(EXECUTABLE) rm -rf $(BIN_IMAGE) +write: all + sudo ../../flash/flash write ./blink.bin 0x08000000 + .PHONY: all clean -- 2.30.2