comparison BSDmakefile.arm @ 0:c59513fd84fb

Initial commit of STM32 test code.
author Daniel O'Connor <darius@dons.net.au>
date Mon, 03 Oct 2011 21:19:15 +1030
parents
children 7a08db98ae8b
comparison
equal deleted inserted replaced
-1:000000000000 0:c59513fd84fb
1 # Cribbed from http://stm32.spacevs.com/index.php?option=com_content&view=category&id=9&Itemid=103 (and others)
2
3 .SUFFIXES: .bin .elf .hex .map .lst .dmp
4
5 .MAIN: ${PROG}.bin
6
7 TCHAIN= arm-none-eabi
8
9 CC= ${TCHAIN}-gcc
10 AS= ${TCHAIN}-gcc
11 CXX= ${TCHAIN}-g++
12 AR= ${TCHAIN}-ar
13 OBJCOPY= ${TCHAIN}-objcopy
14 RM= rm -f
15
16 CFLAGS+= ${COMMONFLAGS}
17
18 LDFLAGS+= ${COMMONFLAGS}
19 LDFLAGS+= -L$(LIBDIR) -nostartfiles -Wl,--gc-sections,-T${LINKFILE}
20
21 OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
22
23 .c.o:
24 ${CC} ${CFLAGS} ${CPPFLAGS} -Wa,-adhlns=${.PREFIX}.lst -c ${.IMPSRC} -o ${.PREFIX}.o
25
26 .s.o:
27 ${AS} ${CFLAGS} ${ASFLAGS} -c ${.IMPSRC} -o ${.PREFIX}.o
28
29 ${PROG}.elf: ${OBJS}
30 ${CC} ${LDFLAGS} ${OBJS} -Wl,-Map=${PROG}.map,--cref -o ${PROG}.elf ${LDADD}
31
32 .elf.bin:
33 ${OBJCOPY} -O binary ${.ALLSRC} ${.TARGET}
34
35 clean:
36 ${RM} ${PROG}.hex ${PROG}.out ${PROG}.elf ${PROG}.bin ${PROG}.map ${OBJS} ${OBJS:S/.o/.lst/} ${PROG}.dmp
37
38 prog:
39 /Users/darius/projects/stm32loader/stm32loader.py -p /dev/tty.usbserial -b 115200 -e -w -v ${PROG}.bin
40
41 #########################
42 #;;; Local Variables: ***
43 #;;; mode:makefile ***
44 #;;; End: ***
45