From: Karl Palsson Date: Mon, 7 Nov 2011 22:56:34 +0000 (+0000) Subject: Fix compile error with new libraries X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=518fe1b0d0b45ab6a9ec217f8b1ce51850077e97;p=fw%2Fstlink Fix compile error with new libraries --- diff --git a/example/32l_dac/Makefile b/example/32l_dac/Makefile index 84db69e..4bd6eb4 100644 --- a/example/32l_dac/Makefile +++ b/example/32l_dac/Makefile @@ -5,25 +5,22 @@ CC=arm-none-eabi-gcc OBJCOPY=arm-none-eabi-objcopy CFLAGS=-O3 -mlittle-endian -mthumb -ifeq ($(CONFIG_STM32L_DISCOVERY), 1) - CFLAGS+=-mcpu=cortex-m3 -DCONFIG_STM32L_DISCOVERY=1 -else ifeq ($(CONFIG_STM32VL_DISCOVERY), 1) - CFLAGS+=-mcpu=cortex-m3 -DCONFIG_STM32VL_DISCOVERY=1 -else ifeq ($(CONFIG_STM32F4_DISCOVERY), 1) - CFLAGS+=-mcpu=cortex-m4 -DCONFIG_STM32F4_DISCOVERY=1 -else -$(error "must specify CONFIG_ for board!") -endif +CFLAGS+=-mcpu=cortex-m3 -DCONFIG_STM32L_DISCOVERY=1 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 -lstm32l_discovery all: $(BIN_IMAGE) @@ -31,7 +28,7 @@ $(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)