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