STM32: add a simple "blinky" example for Olimex STM32-P103.
[bertos.git] / examples / stm32p103 / stm32p103.mk
1 # Copyright 2010 Develer S.r.l. (http://www.develer.com/)
2 #
3 # Makefile for the stm32p103 board example.
4 #
5 # Author: Andrea Righi <arighi@develer.com>
6
7 # Set to 1 for debug builds
8 stm32p103_DEBUG = 0
9
10 include bertos/fonts/fonts.mk
11
12 # Our target application
13 TRG += stm32p103
14
15 stm32p103_CSRC = \
16         bertos/kern/proc.c \
17         bertos/drv/timer.c \
18         bertos/cpu/cortex-m3/drv/gpio_stm32.c \
19         bertos/cpu/cortex-m3/drv/clock_stm32.c \
20         bertos/cpu/cortex-m3/drv/timer_cm3.c \
21         bertos/cpu/cortex-m3/drv/irq_cm3.c \
22         bertos/cpu/cortex-m3/hw/switch_ctx_cm3.c \
23         bertos/cpu/cortex-m3/hw/init_cm3.c \
24         examples/stm32p103/main.c
25
26 stm32p103_CPPASRC = \
27         bertos/cpu/cortex-m3/hw/vectors_cm3.S \
28         bertos/cpu/cortex-m3/hw/crt_cm3.S \
29         #
30
31 # This is an hosted application
32 stm32p103_PREFIX = arm-none-eabi-
33
34 stm32p103_CPPAFLAGS = -mthumb
35 stm32p103_CPPFLAGS = -D'ARCH=0' -D__ARM_STM32P103__ -D'CPU_FREQ=(72000000L)' -D'WIZ_AUTOGEN' -mthumb -Iexamples/stm32p103 -Ibertos/cpu/cortex-m3 -fno-strict-aliasing -fwrapv
36 stm32p103_LDFLAGS = -nostartfiles -T bertos/cpu/cortex-m3/scripts/stm32p103_rom.ld -Wl,--no-warn-mismatch -mthumb
37
38 stm32p103_CPU = cortex-m3
39
40 stm32p103_PROGRAMMER_CPU = stm32
41 stm32p103_PROGRAMMER_TYPE = jtag-tiny
42 stm32p103_FLASH_SCRIPT = bertos/prg_scripts/arm/flash-stm32.sh
43 stm32p103_STOPFLASH_SCRIPT = bertos/prg_scripts/arm/stopopenocd.sh
44 stm32p103_DEBUG_SCRIPT = bertos/prg_scripts/arm/debug.sh
45 stm32p103_STOPDEBUG_SCRIPT = bertos/prg_scripts/arm/stopopenocd.sh
46
47 ifeq ($(stm32p103_DEBUG),0)
48         # Production options
49         stm32p103_CFLAGS += -O0
50         stm32p103_CXXFLAGS += -O0
51 else
52         # Debug options
53         stm32p103_CPPAFLAGS += -g -gdwarf-2
54         stm32p103_CPPFLAGS += -O0 -g3 -gdwarf-2 -fverbose-asm
55 endif