PROJECT=FirstBlinkAttiny44 #the name of the project SOURCES=$(PROJECT).c MMCU=attiny44 F_CPU = 20000000 #define the used crystal frequency CFLAGS=-mmcu=$(MMCU) -Wall -Os -DF_CPU=$(F_CPU) #creat set off the parameters for compiler(MCU,clock) $(PROJECT).hex: $(PROJECT).out avr-objcopy -O ihex $(PROJECT).out $(PROJECT).c.hex;\ #Copy and translate source file ".c" to ".hex" avr-size --mcu=$(MMCU) --format=avr $(PROJECT).out #display the used percentage of flash memory $(PROJECT).out: $(SOURCES) avr-gcc $(CFLAGS) -I./ -o $(PROJECT).out $(SOURCES) #Compile "creat" .hex file from the source .c file program-usbtiny: $(PROJECT).hex avrdude -p t44 -P usb -c usbtiny -U flash:w:$(PROJECT).c.hex #To upload the code to the MCU program-usbtiny-fuses: $(PROJECT).hex avrdude -p t44 -P usb -c usbtiny -U lfuse:w:0x1F:m #To upload the fuses settings to MCU