#!/usr/bin/make -f

#
# Ossuary - an adventure game for the 16K ZX Spectrum
# Make file
#
# Copyright (C) Damian Walker 2013
# Created 28-Jan-2013
#

# The main TAP files
Ossuary.tap: loader.tap title.tap main.tap
	cat loader.tap title.tap main.tap > Ossuary.tap

# The source code ZIP
OssuarySrc.zip: Makefile \
	loader.asm \
	title.scr \
	main.asm \
	variables.asm \
	init.asm newgam.asm newlvl.asm moves.asm menu.asm invent.asm \
	invmnu.asm endgam.asm \
	display.asm msgprt.asm control.asm random.asm arithm.asm noise.asm \
	tape.asm \
	charset.def \
	bintotap.c readme.txt
	zip OssuarySrc.zip \
	Makefile \
	loader.asm \
	title.scr \
	main.asm \
	variables.asm \
	init.asm newgam.asm newlvl.asm moves.asm menu.asm invent.asm \
	invmnu.asm endgam.asm \
	display.asm msgprt.asm control.asm random.asm arithm.asm noise.asm \
	tape.asm \
	charset.def \
	bintotap.c readme.txt

# loader TAP file
loader.tap: loader.bin
	bin2bas -t=Ossuary loader.bin loader.tap

# The loader binary file
loader.bin: loader.asm
	z80asm -b loader.asm

# The title screen block
title.tap: title.scr bintotap
	./bintotap title.scr

# The main game block
main.tap: main.bin
	bintotap main.bin

# The main game binary file
main.bin: main.asm \
	variables.asm \
	init.asm newgam.asm newlvl.asm moves.asm menu.asm invent.asm \
	invmnu.asm endgam.asm \
	display.asm msgprt.asm control.asm random.asm arithm.asm noise.asm \
	tape.asm \
	charset.def
	z80asm -b main.asm

# C utilities that need building
bintotap: bintotap.c
	gcc -o bintotap bintotap.c