From cd0600d7fbb909612eee277d76b1d8700c052788 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Thu, 16 Jan 2020 01:47:25 -0800 Subject: add Makefile --- Makefile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Makefile (limited to 'Makefile') 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 -- cgit v1.2.3-70-g09d2