2
|
1 CFLAGS = -DF_CPU=16000000UL -mmcu=atmega168 -I../include -O2
|
|
2 AVR_JTAG_OBJS = \
|
|
3 avr_jtag.o \
|
|
4 avriotools.o \
|
|
5 cmd_proto.o \
|
|
6 jtag.o
|
|
7 CC= avr-gcc
|
|
8 OBJCOPY= avr-objcopy
|
|
9 PORT?= /dev/cuaU0
|
|
10
|
|
11 all: avr_jtag.hex
|
|
12
|
|
13 avr_jtag.hex: avr_jtag
|
|
14 $(OBJCOPY) -O ihex -R .eeprom $(.ALLSRC) $@
|
|
15
|
|
16 avr_jtag: $(AVR_JTAG_OBJS)
|
|
17 $(CC) -o $@ $(.ALLSRC)
|
|
18
|
|
19 $(AVR_JTAG_OBJS): ${@:C/\.o/.c/}
|
|
20 $(CC) $(CFLAGS) -c $(.ALLSRC)
|
|
21
|
|
22 install:
|
|
23 avrdude -V -F -c stk500v1 -p m168 -b 19200 -P $(PORT) \
|
|
24 -U flash:w:avr_jtag.hex
|
|
25
|
|
26
|
|
27 clean:
|
|
28 @for f in $(AVR_JTAG_OBJS) avr_jtag avr_jtag.hex *~; do \
|
|
29 if [ -e $$f ]; then \
|
|
30 echo "delete $$f"; \
|
|
31 rm -f $$f; \
|
|
32 fi; \
|
|
33 done |