CC = avr-gcc OBJCOPY = avr-objcopy CFLAGS += -mmcu=attiny85 -O2 -Wall TARGET = cl.hex SRC = $(wildcard *.c) OBJ = $(SRC:.c=.o) all: $(TARGET) $(TARGET:.hex=.elf): $(OBJ) $(CC) $(CFLAGS) -o $@ $^ %.hex: %.elf $(OBJCOPY) -j .text -j .data -O ihex $< $@ clean: rm -f $(TARGET) $(TARGET:.hex=.elf) $(OBJ) .PHONY: all clean