#Please when download delete the .txt extension or create an empty file named Makefile with no extension and copy the content of this file to use it #based on Neil's make example for the attiny45.echo.board created by Isma.lb PROJECT=main.night-lamp SOURCES=$(PROJECT).c MCU=attiny45 F_CPU = 8000000 PROGRAMER = usbtiny CFLAGS=-mmcu=$(MCU) -Wall -Os -DF_CPU=$(F_CPU) $(PROJECT).hex: $(PROJECT).out avr-objcopy -j .text -j .data -O ihex $< $@ avr-size -C --mcu=$(MCU) $< $(PROJECT).out: $(SOURCES) avr-gcc $(CFLAGS) -o $(PROJECT).out $(SOURCES) flash: avrdude -c $(PROGRAMER) -p $(MCU) -U flash:w:$(PROJECT).hex build:$(PROJECT).hex upload:$(PROJECT).hex make flash avr-size -C --mcu=$(MCU) $(PROJECT).out clean: rm -f *.hex *.elf *.out ls .PHONY: clean