model=attiny85 BIN=t85rgbled DEVICE =t85 PROGRAMMER =usbasp #all: comp ${BIN}.hex : ${BIN}.elf avr-objcopy -j .text -j .data -O ihex ${BIN}.elf ${BIN}.hex ${BIN}.elf : ${BIN}.o avr-gcc -g -mmcu=${model} -o ${BIN}.elf ${BIN}.o avr-size -B ${BIN}.elf ${BIN}.o : ${BIN}.c avr-gcc -g -Os -mmcu=${model} -c ${BIN}.c #comp: ${BIN}.c # avr-gcc -g -Os -mmcu=${model} -c ${BIN}.c # avr-gcc -g -mmcu=${model} -o ${BIN}.elf ${BIN}.o # avr-size -B ${BIN}.elf # avr-objcopy -j .text -j .data -O ihex ${BIN}.elf ${BIN}.hex upload: avrdude -p $(DEVICE) -c $(PROGRAMMER) -e -U flash:w:$(BIN).hex #u must use tab to make a space for the first line of each section #use make upload to use avrdude