]>
Commit | Line | Data |
---|---|---|
1 | PROG=dragon_jtag | |
2 | PORT=usb | |
3 | PMCU=m16 | |
4 | GCCMCU=atmega16 | |
5 | #Fuses for 1MHz: | |
6 | #avrdude -v -p m16 -U lfuse:w:0xa1:m -U hfuse:w:0x19:m | |
7 | ||
8 | CPUFLAG=-mmcu=$(GCCMCU) | |
9 | CC=avr-gcc | |
10 | CFLAGS=$(CPUFLAG) -DF_CPU=1000000UL -Wall -g | |
11 | LDFLAGS=$(CPUFLAG) | |
12 | OBJCOPY=avr-objcopy | |
13 | ||
14 | all: bmc.bin | |
15 | ||
16 | bmc: bmc.o usart.o i2c.o ipmb.o chassis.o | |
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 | |
27 | ||
28 | clean: | |
29 | -rm -f *.o bmc bmc.bin | |
30 | ||
31 | .PHONY: all clean flash debug |