Added multiple-board support to blink_flash Makefile
authorNed Konz <ned@productcreationstudio.com>
Thu, 20 Oct 2011 01:55:29 +0000 (18:55 -0700)
committerNed Konz <ned@productcreationstudio.com>
Thu, 20 Oct 2011 01:55:29 +0000 (18:55 -0700)
example/blink_flash/Makefile

index d0583902969d5baeeb75bf45055cd94a921970ca..77764715d9f42de214acc8895786329624ff49cb 100644 (file)
@@ -5,7 +5,18 @@ CC=arm-none-eabi-gcc
 OBJCOPY=arm-none-eabi-objcopy
 
 CFLAGS=-O2 -mlittle-endian -mthumb
-CFLAGS+=-mcpu=cortex-m3 -ffreestanding -nostdlib -nostdinc
+
+CFLAGS=-g -O2 -mlittle-endian -mthumb
+ifeq ($(CONFIG_STM32L_DISCOVERY), 1)
+       CFLAGS+=-mcpu=cortex-m3 -DCONFIG_STM32L_DISCOVERY
+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+=-ffreestanding -nostdlib -nostdinc
 
 # to run from FLASH
 CFLAGS+=-Wl,-T,stm32_flash.ld