summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile22
1 files changed, 22 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..792f0ab
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,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