summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2020-01-16 01:47:25 -0800
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2020-01-16 01:47:25 -0800
commitcd0600d7fbb909612eee277d76b1d8700c052788 (patch)
treeab42be0eff7f0d46c99473709e4d27dbff338f15 /Makefile
parent96b68d03cf1e8536212461018c174ed3dfadc4ea (diff)
downloadchristmas_lights-master.tar.gz
christmas_lights-master.tar.xz
add MakefileHEADmaster
Diffstat (limited to 'Makefile')
-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