# HG changeset patch # User Thinker K.F. Li # Date 1235313806 -28800 # Node ID 705da39cdf910dde5e4adedf178875982f784293 # Parent 074e860d7d316ae616a528e42ce3c88a6c1a0b04 Makefile for tests diff -r 074e860d7d31 -r 705da39cdf91 tests/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/Makefile Sun Feb 22 22:43:26 2009 +0800 @@ -0,0 +1,35 @@ +HEXS := ledtest.hex cptest.hex +CC := avr-gcc +OBJCOPY := avr-objcopy +CFLAGS := -DF_CPU=16000000UL -mmcu=atmega168 -I../include -O +PORT?= /dev/cuaU0 + +all: $(HEXS) + +ledtest.hex: ledtest + $(OBJCOPY) -O ihex -R .eeprom $(.ALLSRC) $@ + +cptest.hex: cptest + $(OBJCOPY) -O ihex -R .eeprom $(.ALLSRC) $@ + +cptest: cptest.c ../src/cmd_proto.c ../src/avriotools.c + $(CC) $(CFLAGS) -o $@ $(.ALLSRC) + +ledtest: ledtest.c ../src/avriotools.c + $(CC) $(CFLAGS) -o $@ $(.ALLSRC) + +install-ledtest: + avrdude -V -F -c stk500v1 -p m168 -b 19200 -P $(PORT) \ + -U flash:w:ledtest.hex + +install-cptest: + avrdude -V -F -c stk500v1 -p m168 -b 19200 -P $(PORT) \ + -U flash:w:cptest.hex + +clean: + @for f in $(HEXS) ${HEXS:C/\.hex//} *~; do \ + if [ -e $$f ]; then \ + echo "delete $$f"; \ + rm -f $$f; \ + fi; \ + done