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