preparing for C -> ASM
authorTobias Girstmair <t@thi3nkpad.lan>
Tue, 11 Dec 2018 00:48:46 +0000 (01:48 +0100)
committerTobias Girstmair <t@thi3nkpad.lan>
Tue, 11 Dec 2018 00:49:34 +0000 (01:49 +0100)
Makefile
foo.S [moved from foo.c with 100% similarity]

index 8eddac4..2d1a3d9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,14 @@
-a.out: foo.c
-       gcc foo.c
-       ./a.out |head -c31457280 |diff -s - full-orig.pcm
-       # NOTE: starts to diverge after 33423360 bytes
-       git add foo.c
-       git commit -m "new version"
-
-.PHONY: test
-test:
-       gcc foo.c
-       ./a.out |head -c31457280 |diff -s - full-orig.pcm
+.PHONY: all clean flash
+CHIP ?= 9
+
+all: foo.elf
+
+foo.elf: foo.S
+       avr-gcc -Os -nostdlib -mmcu=attiny$(CHIP) -o $@ $<
+       avr-size -C --mcu=attiny$(CHIP) $@
+
+flash: foo.elf
+       avrdude -cusbasp -Pusb -pt$(CHIP) -Uflash:w:$<:e
+
+clean:
+       rm -f foo.elf
diff --git a/foo.c b/foo.S
similarity index 100%
rename from foo.c
rename to foo.S
Imprint / Impressum