#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.board SOURCES=$(PROJECT).c VPATH= lib MCU=atmega328p F_CPU = 8000000 PROGRAMER = usbtiny OBJ = lib/TouchBtn.o lib/millis.o CFLAGS= -I lib -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: $(PROJECT).o $(OBJ) avr-gcc $(CFLAGS) -o $@ $^ $(PROJECT).o: $(PROJECT).c avr-g++ $(CFLAGS) -c $< lib/%.o: lib/%.cpp lib/%.h avr-g++ $(CFLAGS) -c $< -o $@ lib/%.o: lib/%.c lib/%.h avr-gcc $(CFLAGS) -c $< -o $@ 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: del /s *.hex *.out *.o dir /b .PHONY: clean