Mercurial > ~darius > hgwebdir.cgi > avr
annotate Makefile.avr @ 32:b0cb873c0206
Isolate the bus frobbing parts and the delays into a separate header.
This means the user only has to edit a single file to suit their
situation and allows the code to work with active drive systems as
well as passive pullups (ie 1 vs 2 IO pins)
author | darius |
---|---|
date | Sun, 23 Apr 2006 22:57:16 +0930 |
parents | 59c7fcf10ea0 |
children | 2b8278ec5adb |
rev | line source |
---|---|
14 | 1 # |
2 # $Id$ | |
3 # | |
4 | |
2 | 5 .SUFFIXES: .hex .out .c .o .elf .dmp .s |
6 | |
7 # Programs | |
8 AS=avr-as | |
9 CC=avr-gcc | |
10 OBJCOPY=avr-objcopy | |
11 OBJDUMP=avr-objdump | |
12 | |
13 CPPFLAGS+=-Wa,-adhlmsn=${<:S/.c/.lst/} | |
14 | |
18
108a703c39e6
Covert to a later version of avr-libc. Stuff like not using inb/outb,
darius
parents:
14
diff
changeset
|
15 MCU?=at90s8515 |
2 | 16 CFLAGS+=-mmcu=${MCU} |
17 | |
18 LDFLAGS+=-Wl,-Map=${PROG}.map,--cref | |
19 LDFLAGS+=${LDADD} | |
20 | |
21 RM=rm -f | |
22 | |
23 PROGRAMMER=avrdude | |
24 PROGOPTS=-p ${PART} -c alf -E vcc,noreset -q | |
25 | |
26 .if !defined(SRCS) | |
27 SRCS= ${PROG}.c | |
28 .endif | |
29 | |
30 OBJS+= ${SRCS:N*.h:R:S/$/.o/g} | |
31 | |
32 all: ${PROG}.hex ${PROG}.dmp | |
33 | |
34 .c.o: | |
35 ${CC} ${CFLAGS} ${CPPFLAGS} -c ${.IMPSRC} -o ${.PREFIX}.o | |
36 | |
37 ${PROG}.elf: ${OBJS} | |
38 ${CC} ${CFLAGS} ${LDFLAGS} -g ${OBJS} -o ${PROG}.elf ${LDADD} | |
39 | |
40 .elf.hex: | |
20
59c7fcf10ea0
Copy the correct segments into the flash image otherwise pre-declared
darius
parents:
18
diff
changeset
|
41 ${OBJCOPY} -j .text -j .data -j .bss -j .noinit -O ihex $> $@ |
2 | 42 |
43 .elf.dmp: | |
44 ${OBJDUMP} -S ${.IMPSRC} > ${.PREFIX}.dmp | |
45 | |
46 clean: | |
6 | 47 ${RM} ${PROG}.hex ${PROG}.out ${PROG}.elf ${PROG}.map ${OBJS} ${OBJS:S/.o/.lst/} ${PROG}.dmp |
2 | 48 |
49 prog: all | |
50 ${PROGRAMMER} -U flash:w:${PROG}.hex ${PROGOPTS} | |
51 | |
52 |