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