# makefile for ZX81 tetris/tetrishr/tetris1k
#
# note that you'll need to compile `bin2p' for this to work, and
# you'll also need zmac from comp.sources.unix volume 9 patched with
# the `zmac.dif' patch.

all: tetris.p tetrishr.p t1k.p

TETRISSRC=tetris.z readkybd.z rand.z maths.z asciiprn.z

TETRISHRSRC=tetrishr.z hires.z readkybd.z rand.z txtbmp.z title.z

tetris.p: $(TETRISSRC) bin2p
	cat $(TETRISSRC) >out.z
	zmac out.z
	./bin2p out.bin tetris.p

tetrishr.p: $(TETRISHRSRC) bin2p
	cat $(TETRISHRSRC) >out.z
	zmac out.z
	./bin2p out.bin tetrishr.p

t1k.p: tetris1k.z bin2p
	zmac tetris1k.z
	./bin2p tetris1k.bin t1k.p
	@echo Be sure to read about the 1k version in tetris.txt before
	@echo trying to run it.

txtbmp.z: txtbmp.pbm genbmps.c genbmps
	./genbmps <txtbmp.pbm >txtbmp.z

title.z: title.pbm gentitle.c gentitle
	./gentitle <title.pbm >title.z

clean:
	$(RM) *~ *.lst *.bin out.z bin2p genbmps gentitle \
		t1k.p txtbmp.z title.z

tar:
	cd ..;tar -cvhf - tetris | gzip >$(HOME)/tmp/tetris-src.tar.gz
