From 0883137f5c02ef9fe4de56bda216d57d29f25c84 Mon Sep 17 00:00:00 2001 From: Tobias Girstmair Date: Tue, 11 Dec 2018 01:48:46 +0100 Subject: [PATCH] preparing for C -> ASM --- Makefile | 25 ++++++++++++++----------- foo.c => foo.S | 0 2 files changed, 14 insertions(+), 11 deletions(-) rename foo.c => foo.S (100%) 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 -- 2.39.3