Create a gist now

Instantly share code, notes, and snippets.

@geekman /Makefile
Last active Sep 6, 2017

What would you like to do?
Makefile for an ATtiny10 project
#
# Makefile for an ATtiny10 project
#
CC=avr-gcc
OBJCOPY=avr-objcopy
OBJDUMP=avr-objdump
#F_CPU := 8000000
MCU := attiny10
CFLAGS += -Wall -Os -g -mmcu=$(MCU)
#CFLAGS += -DF_CPU=$(F_CPU)
.PRECIOUS: %.o %.elf
.PHONY: clean all
all: test.elf
test.elf: test.o
%.lss: %.elf
$(OBJDUMP) -S $< > $@
%.elf:
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
avr-size -C --mcu=$(MCU) $@
clean:
$(RM) -f *.o *.elf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment