comparison BSDmakefile @ 3:74e9b3baac1e

Jumbo commit to make things work. Note I have t
author Daniel O'Connor <darius@dons.net.au>
date Sun, 01 Jan 2012 11:01:13 +1030
parents 7a08db98ae8b
children 2c87e30c982d
comparison
equal deleted inserted replaced
2:274e01fa5a4c 3:74e9b3baac1e
1 PROG= main 1 PROG= main
2 2
3 SRCS= main.c \ 3 SRCS= comm.c \
4 comm.c \ 4 core_cm3.c \
5 lcd.c \
6 main.c \
7 misc.c \
8 startup_stm32f10x_md_mthomas.c \
5 syscalls.c \ 9 syscalls.c \
6 startup_stm32f10x_md_mthomas.c \
7 core_cm3.c \
8 system_stm32f10x.c \ 10 system_stm32f10x.c \
9 stm32f10x_usart.c \ 11
10 stm32f10x_flash.c \ 12 STM32LIBS= usart gpio rcc rtc pwr bkp fsmc
11 stm32f10x_gpio.c \ 13
12 stm32f10x_rcc.c \ 14 .for f in ${STM32LIBS}
13 stm32f10x_spi.c \ 15 SRCS+= stm32f10x_${f}.c
14 stm32f10x_rtc.c \ 16 CFLAGS+= -DSTM32F10X_${f:U}_EN
15 stm32f10x_bkp.c \ 17 .endfor
16 stm32f10x_pwr.c \
17 stm32f10x_dma.c \
18 stm32f10x_tim.c \
19 misc.c
20 18
21 # Linker file 19 # Linker file
22 LINKFILE= ${.CURDIR}/STM32F10x_512k_64k_flash.ld 20 LINKFILE= ${.CURDIR}/STM32F10x_512k_64k_flash.ld
23 21
24 # Set CPU type 22 # Set CPU type
25 COMMONFLAGS= -mcpu=cortex-m3 23 COMMONFLAGS= -mcpu=cortex-m3
26 # Enable thumb code (since the Cortex M3 only does thumb) 24 # Enable thumb code (since the Cortex M3 only does thumb)
27 COMMONFLAGS+= -mthumb 25 COMMONFLAGS+= -mthumb
28 # Debugging & optimisation 26 # Debugging & optimisation
29 COMMONFLAGS+= -g -Os 27 COMMONFLAGS+= -g -O2
30 # Put functions & data in individual sections to allow the linker to optimise (breaks debugging apparently) 28 # Put functions & data in individual sections to allow the linker to optimise (breaks debugging apparently)
31 #COMMONFLAGS+= -ffunction-sections -fdata-sections 29 #COMMONFLAGS+= -ffunction-sections -fdata-sections
32 # We aren't using exceptions 30 # We aren't using exceptions
33 COMMONFLAGS+= -fno-exceptions 31 COMMONFLAGS+= -fno-exceptions
34 32
35 CFLAGS+= -I ${.CURDIR} 33 CFLAGS+= -I ${.CURDIR}
36 34
37 # Set device type 35 # Set device type
38 CFLAGS+= -DSTM32F10X_MD 36 CFLAGS+= -DSTM32F10X_HD
39 # Set clocks 37 # Set clocks
40 CFLAGS+= -DHSE_VALUE=8000000UL -DSYSCLK_FREQ_72MHz=72000000 38 CFLAGS+= -DHSE_VALUE=8000000UL -DSYSCLK_FREQ_72MHz=72000000
41 # Enable STM peripheral drivers 39 # Enable STM peripheral drivers
42 CFLAGS+= -DUSE_STDPERIPH_DRIVER 40 CFLAGS+= -DUSE_STDPERIPH_DRIVER
43 # Enable startup delay 41 # Enable startup delay
44 #CFLAGS+= -DSTARTUP_DELAY 42 #CFLAGS+= -DSTARTUP_DELAY
45 # Vector table in flash 43 # Vector table in flash
46 CFLAGS+= -DVECT_TAB_FLASH 44 CFLAGS+= -DVECT_TAB_FLASH
45 CFLAGS+= -mthumb-interwork
47 # Enable warnings (disable char-subscripts otherwise ctypes.h generates warnings 46 # Enable warnings (disable char-subscripts otherwise ctypes.h generates warnings
48 CFLAGS+= -Wall -Wextra -pedantic -Wimplicit -Wcast-align -Wpointer-arith -Wredundant-decls -Wshadow -Wcast-qual -Wcast-align -Wnested-externs -Wno-char-subscripts -std=gnu99 47 CFLAGS+= -Wall -Wextra -pedantic -Wimplicit -Wcast-align -Wpointer-arith -Wredundant-decls -Wshadow -Wcast-qual -Wcast-align -Wnested-externs -Wno-char-subscripts -std=gnu99
49 48
50 LDFLAGS= -nostartfiles -Wl,--gc-sections -lc -lm -lgcc 49 LDFLAGS= -nostartfiles -Wl,--gc-sections -lc -lm -lgcc
51 50
62 .PATH: ${PERIPHDIR}/src 61 .PATH: ${PERIPHDIR}/src
63 .PATH: ${COREDIR} 62 .PATH: ${COREDIR}
64 .PATH: ${SYSDIR} 63 .PATH: ${SYSDIR}
65 64
66 debug: 65 debug:
67 ${GDB} --eval-command="target remote 10.211.55.3:61234" --eval-command "load" ${PROG}.elf 66 ${GDB} --eval-command="target remote 127.0.0.1:61234" ${PROG}.elf
67
68 load:
69 ${GDB} --eval-command="target remote 127.0.0.1:61234" --eval-command "load" ${PROG}.elf
68 70
69 .include "${.CURDIR}/BSDmakefile.arm" 71 .include "${.CURDIR}/BSDmakefile.arm"