# 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 tetris1k.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

tetris1k.p: tetris1k.z bin2psml
	zmac tetris1k.z
	./bin2psml tetris1k.bin tetris1k.p

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 bin2psml genbmps gentitle \
		txtbmp.z title.z

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