]>
Commit | Line | Data |
---|---|---|
d7bda89e MG |
1 | PROG=dragon_jtag |
2 | PORT=usb | |
3 | PMCU=m16 | |
7f52e040 MG |
4 | GCCMCU=atmega16 |
5 | ||
6 | CPUFLAG=-mmcu=$(GCCMCU) | |
7 | CC=avr-gcc | |
8 | CFLAGS=$(CPUFLAG) -DF_CPU=8000000UL -Wall -g | |
9 | LDFLAGS=$(CPUFLAG) | |
10 | OBJCOPY=avr-objcopy | |
d7bda89e MG |
11 | |
12 | all: bmc.bin | |
13 | ||
99e4226b | 14 | bmc: bmc.o usart.o i2c.o |
d7bda89e MG |
15 | |
16 | bmc.bin: bmc | |
17 | $(OBJCOPY) -j .text -j .data -O binary $^ $@ | |
18 | ||
19 | flash: bmc.bin | |
20 | avrdude -v -c $(PROG) -P $(PORT) -p $(PMCU) -U flash:w:$^ | |
21 | ||
22 | debug: bmc bmc.bin | |
23 | setsid avarice -g -D :4242 | |
24 | -avr-gdb -ex 'target remote localhost:4242' bmc | |
d7bda89e MG |
25 | |
26 | clean: | |
27 | -rm -f *.o bmc bmc.bin | |
28 | ||
29 | .PHONY: all clean flash debug |