From b3ea0d9932c8aa6cdd769e7d3d70344cd672b363 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Tue, 23 Feb 2010 00:40:40 -0500 Subject: [PATCH] Move songs into songs/ dir and improve Makefile --- Makefile | 23 ++++++++++++++--------- {tracker => songs}/test2.song | 0 2 files changed, 14 insertions(+), 9 deletions(-) rename {tracker => songs}/test2.song (100%) diff --git a/Makefile b/Makefile index 12f8411..1029e4f 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ target/%: CC=avr-gcc target/%: LD=avr-ld target/%: AS=avr-as -all: tracker/tracker target/flash.hex +all: tracker/tracker target/test2.hex progenv/gentimes.c: progenv/gentimes.pl perl $^ --mode=C --fcpu=${CPU_FREQUENCY} --samprate=${SAMPLE_RATE} > $@ @@ -25,23 +25,28 @@ progenv/gentimes.c: progenv/gentimes.pl progenv/gentimes.h: progenv/gentimes.pl perl $^ --mode=H --fcpu=${CPU_FREQUENCY} --samprate=${SAMPLE_RATE} > $@ -tracker/chip.o: progenv/gentimes.h -target/flash.o: progenv/gentimes.h progenv/gentimes.o: progenv/gentimes.h +.INTERMEDIATE: songs/%.h +songs/%.s songs/%.h : songs/%.song | tracker/tracker + tracker/tracker --export $^ songs/$* + +tracker/chip.o: progenv/gentimes.h + tracker/tracker: tracker/main.o tracker/chip.o tracker/gui.o progenv/gentimes.o ${CC} ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ -target/flash.o: target/main.c target/asm.S tracker/exported.s progenv/gentimes.c - ${CC} ${CPPFLAGS} ${CFLAGS} -o $@ $^ +target/%.o: target/main.c target/asm.S songs/%.s progenv/gentimes.c | progenv/gentimes.h songs/%.h + ${CC} ${CPPFLAGS} ${CFLAGS} --include="songs/$*.h" -o $@ $^ -target/flash.hex: target/flash.o +target/%.hex: target/%.o ${LD} ${LDFLAGS} --oformat ihex -o $@ $^ > target/mapfile -target/flash.da: target/flash.o - avr-objdump -S target/flash.o > target/flash.da +target/%.da: target/%.o + avr-objdump -S $^ > $@ clean: + rm -f songs/*.s songs/*.h rm -f tracker/*.o tracker/tracker - rm -f target/*.o target/mapfile target/flash.* + rm -f target/*.o target/mapfile target/*.hex rm -f progenv/gentimes.[ch] diff --git a/tracker/test2.song b/songs/test2.song similarity index 100% rename from tracker/test2.song rename to songs/test2.song -- 2.50.1