comparison tests/Makefile @ 9:705da39cdf91

Makefile for tests
author Thinker K.F. Li <thinker@branda.to>
date Sun, 22 Feb 2009 22:43:26 +0800
parents
children
comparison
equal deleted inserted replaced
8:074e860d7d31 9:705da39cdf91
1 HEXS := ledtest.hex cptest.hex
2 CC := avr-gcc
3 OBJCOPY := avr-objcopy
4 CFLAGS := -DF_CPU=16000000UL -mmcu=atmega168 -I../include -O
5 PORT?= /dev/cuaU0
6
7 all: $(HEXS)
8
9 ledtest.hex: ledtest
10 $(OBJCOPY) -O ihex -R .eeprom $(.ALLSRC) $@
11
12 cptest.hex: cptest
13 $(OBJCOPY) -O ihex -R .eeprom $(.ALLSRC) $@
14
15 cptest: cptest.c ../src/cmd_proto.c ../src/avriotools.c
16 $(CC) $(CFLAGS) -o $@ $(.ALLSRC)
17
18 ledtest: ledtest.c ../src/avriotools.c
19 $(CC) $(CFLAGS) -o $@ $(.ALLSRC)
20
21 install-ledtest:
22 avrdude -V -F -c stk500v1 -p m168 -b 19200 -P $(PORT) \
23 -U flash:w:ledtest.hex
24
25 install-cptest:
26 avrdude -V -F -c stk500v1 -p m168 -b 19200 -P $(PORT) \
27 -U flash:w:cptest.hex
28
29 clean:
30 @for f in $(HEXS) ${HEXS:C/\.hex//} *~; do \
31 if [ -e $$f ]; then \
32 echo "delete $$f"; \
33 rm -f $$f; \
34 fi; \
35 done