summaryrefslogtreecommitdiff
path: root/Makefile
blob: 792f0abf6b0a6c01a1e7d7bc04064cdbef57dcf1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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