all: decman.tap listing.txt decman.wav

listing.txt: decman.tap
	echo "DEC-Man Listing for the 2026 BASIC 10Liner Competition (PUR-80 Category) by mcphail (btl AT mcphail.uk)" > $@
	echo "-------------------------------------------------------------------------------------------------------" >> $@
	echo "\n (Note - Line 1 has 4 extra control characters before the line of dots for PAPER BLACK and INK GREEN." >> $@
	echo "  These characters are shown in the listing as € signs.)\n" >> $@
	echo "....> ---------|---------|---------|---------|---------|---------|---------|---------|" >> $@
	listbasic $^ | sed 's/"  /"  €€€€/' >> $@
	echo "....> ---------|---------|---------|---------|---------|---------|---------|---------|" >> $@
	
decman.tap: pac.bas
	zmakebas -l -i 1 -s 1 -n DEC-Man -a 1 -o $@ $^

decman.wav: decman.tap
	tape2wav $^ $@

clean:
	rm -f *.tap listing.txt *.wav

.PHONY: all clean