-CC=avr-gcc
-CFLAGS=-mmcu=atmega16 -g
-OBJCOPY=avr-objcopy
PROG=dragon_jtag
PORT=usb
PMCU=m16
+GCCMCU=atmega16
+
+CPUFLAG=-mmcu=$(GCCMCU)
+CC=avr-gcc
+CFLAGS=$(CPUFLAG) -DF_CPU=8000000UL -Wall -g
+LDFLAGS=$(CPUFLAG)
+OBJCOPY=avr-objcopy
all: bmc.bin
-bmc: bmc.o
+bmc: bmc.o usart.o i2c.o ipmb.o chassis.o
bmc.bin: bmc
$(OBJCOPY) -j .text -j .data -O binary $^ $@