#  amaze : a distributed multi-person Vkernel game.
#  Copyright (c) 1982 David R. Cheriton
#
# Makefile for amaze
# 

HEADERS= amaze.h
SOURCES= processes.c init.c inputhandler.c communicate.c state.c draw.c test.c
OBJECTS= processes.b init.b inputhandler.b communicate.b state.b draw.b test.b
#ifdef X
C68FLAGS = -DMC68000 -O -V -vx
#else X
C68FLAGS =  -DMC68000 -O -V
#endif X
LIBS = -lgraphics -lVexcept

# first, define the world of 68000s
.SUFFIXES: .b .ls .a68 .c

# how to compile a 68000 file
.c.b:
	cc68 $(C68FLAGS) -c $*.c 

# how to make an assembly file (Not deleting it or assembling it)
.c.s:
	cc68 $(C68FLAGS) -S $*.c

# how to make an assembly listing
.c.ls:
	cc68 $(C68FLAGS) -c -L $*.c

#END world of 68000's

# compile everything that needs it

amaze: $(OBJECTS)
	cc68 $(C68FLAGS) -r -o amaze  $(OBJECTS) $(LIBS) 

$(OBJECTS): $(HEADERS)

install: amaze
#ifdef X
	netinstall -x amaze /usr/sun/xVboot
#else X
	netinstall "amaze" /usr/sun/Vboot "shasta navajo"
#endif X

clean:
	rm -f *.BAK *.CKP *.b amaze

backup:
	cd ..; cpdir amaze ../../Vbackup/cmds/amaze

build:
	buildmake.sh

xbuild:
	buildmake.sh -DX=1
