From: Tobias Girstmair Date: Tue, 11 Dec 2018 00:48:46 +0000 (+0100) Subject: preparing for C -> ASM X-Git-Tag: attiny9~19 X-Git-Url: https://git.gir.st/Chiptunes.git/commitdiff_plain/0883137f5c02ef9fe4de56bda216d57d29f25c84 preparing for C -> ASM --- diff --git a/Makefile b/Makefile index 8eddac4..2d1a3d9 100644 --- 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