X-Git-Url: https://git.gir.st/Chiptunes.git/blobdiff_plain/6d7c77457dcbbaeade909b00aa4849139825a273..19e320a6e4e5d43ac3f85f6dd6e4de37fd0bb544:/Makefile 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