ATtiny85 avr-gcc / avrdude Makefile
DEVICE = attiny85 | |
CLOCK = 8000000 | |
PROGRAMMER = stk500v1 | |
PORT = /dev/tty.usbmodem1421 | |
BAUD = 19200 | |
FILENAME = main | |
COMPILE = avr-gcc -Wall -Os -DF_CPU=$(CLOCK) -mmcu=$(DEVICE) | |
all: usb clean build upload | |
usb: | |
ls /dev/cu.* | |
build: | |
$(COMPILE) -c $(FILENAME).c -o $(FILENAME).o | |
$(COMPILE) -o $(FILENAME).elf $(FILENAME).o | |
avr-objcopy -j .text -j .data -O ihex $(FILENAME).elf $(FILENAME).hex | |
avr-size --format=avr --mcu=$(DEVICE) $(FILENAME).elf | |
upload: | |
avrdude -v -p $(DEVICE) -c $(PROGRAMMER) -P $(PORT) -b $(BAUD) -U flash:w:$(FILENAME).hex:i | |
clean: | |
rm main.o | |
rm main.elf | |
rm main.hex |
This comment has been minimized.
This comment has been minimized.
Really Nice! Most useful Makefile I've used! |
This comment has been minimized.
This comment has been minimized.
According to
Here is how my fork of your Makefile currently looks like:
|
This comment has been minimized.
This comment has been minimized.
@edwardhotchkiss - thank you! This is really simple and it works, unlike every other avr-gcc makefile on the web. @vyorkin - your
instead of
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
This is great. Thanks for the concise makefile!