annotate Makefile.avr @ 13:2c03ec600dbc OWIRE_1_3

Reduce object code size as much as possible.
author darius
date Wed, 01 Sep 2004 17:46:15 +0930
parents 0da70b744078
children a9d493261c6c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
1 .SUFFIXES: .hex .out .c .o .elf .dmp .s
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
2
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
3 # Programs
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
4 AS=avr-as
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
5 CC=avr-gcc
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
6 OBJCOPY=avr-objcopy
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
7 OBJDUMP=avr-objdump
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
8
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
9 CPPFLAGS+=-Wa,-adhlmsn=${<:S/.c/.lst/}
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
10
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
11 PART?=8515
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
12 MCU?=at90s${PART}
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
13 CFLAGS+=-mmcu=${MCU}
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
14
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
15 LDFLAGS+=-Wl,-Map=${PROG}.map,--cref
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
16 LDFLAGS+=${LDADD}
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
17
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
18 RM=rm -f
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
19
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
20 PROGRAMMER=avrdude
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
21 PROGOPTS=-p ${PART} -c alf -E vcc,noreset -q
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
22
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
23 .if !defined(SRCS)
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
24 SRCS= ${PROG}.c
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
25 .endif
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
26
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
27 OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
28
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
29 all: ${PROG}.hex ${PROG}.dmp
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
30
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
31 .c.o:
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
32 ${CC} ${CFLAGS} ${CPPFLAGS} -c ${.IMPSRC} -o ${.PREFIX}.o
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
33
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
34 ${PROG}.elf: ${OBJS}
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
35 ${CC} ${CFLAGS} ${LDFLAGS} -g ${OBJS} -o ${PROG}.elf ${LDADD}
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
36
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
37 .elf.hex:
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
38 ${OBJCOPY} -j .text -O ihex $> $@
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
39
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
40 .elf.dmp:
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
41 ${OBJDUMP} -S ${.IMPSRC} > ${.PREFIX}.dmp
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
42
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
43 clean:
6
0da70b744078 Clean the right files.
darius
parents: 2
diff changeset
44 ${RM} ${PROG}.hex ${PROG}.out ${PROG}.elf ${PROG}.map ${OBJS} ${OBJS:S/.o/.lst/} ${PROG}.dmp
2
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
45
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
46 prog: all
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
47 ${PROGRAMMER} -U flash:w:${PROG}.hex ${PROGOPTS}
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
48
288d801a47ff Use nicer build framework.
darius
parents:
diff changeset
49