all : program.hex burn program.lst CC = avr-gcc OBJS = main.o SRCS = main.c PROCESSOR=atmega644 PROGRAMCODE=m644 CFLAGS = -Wall -O3 -mmcu=$(PROCESSOR) -DF_CPU=20000000UL -I. -Iusbdrv ASFLAGS = $(CFLAGS) -x assembler-with-cpp program.elf : $(OBJS) avr-gcc -I -mmcu=$(PROCESSOR) $(CFLAGS) -Wl,-Map,program.map -o $@ $^ -L /usr/lib64/binutils/avr/2.19.1 program.hex : program.elf avr-objcopy -j .text -j .data -O ihex program.elf program.hex program.lst : $(SRCS) avr-gcc -c -g -Wa,-a,-ad $(CFLAGS) $^ > $@ burn : program.hex avrdude -c usbtiny -p $(PROGRAMCODE) -U flash:w:program.hex -F readfuses : avrdude -c usbtiny -p $(PROGRAMCODE) -U hfuse:r:high.txt:b -U lfuse:r:low.txt:b #Extern oscillator in + clkout enabled. burnfuses : avrdude -c usbtiny -p $(PROGRAMCODE) -U lfuse:w:0xBE:m -U hfuse:w:0xD9:m -F clean : rm -f *~ high.txt low.txt program.hex program.map program.elf $(OBJS) *.o program.lst serial : stty -F /dev/ttyUSB0 4800 -parenb -echo -cstopb