CC=avr-gcc CFLAGS=-mmcu=$(MMCU) -Wall -Os -DF_CPU=$(F_CPU) -std=c++11 MMCU=attiny44 PROGRAMMER=usbtiny#avr910 DEVICE=usb#/dev/ttyUSB0 F_CPU=1000000 MAIN=led SOURCES=$(MAIN).cpp all: $(MAIN).hex # Implicit rule to create hex files from source files %.hex: %.out # $< is the first dependency # $@ is the left side of the rule avr-objcopy -O ihex $< $@ avr-size --mcu=$(MMCU) --format=avr $< %.out: $(SOURCES) $(CC) $(CFLAGS) -I./ $< -o $@ program: $(MAIN).hex avrdude -p t44 -P $(DEVICE) -c $(PROGRAMMER) -U flash:w:$< clean: rm *.hex