#
#  Makefile for mazewar.
#

CFILES =	actions.c calldaemon.c comm.c death.c getsocket.c init.c \
		initpix.c initplayer.c ioctls.c main.c packet.c player.c \
		redraw.c send.c service.c setkeyok.c ualarm.c \
		util.c viewwin.c wintext.c work.c

OFILES =	actions.o calldaemon.o comm.o death.o getsocket.o init.o \
		initplayer.o ioctls.o main.o packet.o send.o \
		service.o setkeyok.o ualarm.o util.o work.o \
		../daemon/syserr.o ../daemon/vers.o

SUNFILES =	initpix.o player.o redraw.o viewwin.o wintext.o

HFILES =	../h/defs.h ../h/struct.h ../h/extern.h ../h/sunscreen.h \
		../h/hallmap.h ../h/arrows.h ../h/wall_image.h ../h/data.h \
		../h/corners.h

LIBS =		-lm -lcurses -ltermlib
SUNLIBS	= 	$(LIBS) -lpixrect

CFLAGS =	-O -DPLUS5

vax:		$(OFILES)
		$(CC) $(CFLAGS) $(OFILES) $(LIBS) -o mazewar

sun:		$(OFILES) $(SUNFILES)
		$(CC) $(CFLAGS) $(OFILES) $(SUNFILES) $(SUNLIBS)  -o mazewar

prmaze:		prmaze.o
		$(CC) $(CFLAGS) prmaze.o -o prmaze

ctags:
		ctags $(CFILES) $(HFILES)

clean:
		rm -f *.o mazewar core *.out

actions.o:       ../h/defs.h
calldaemon.o:    ../h/defs.h ../h/struct.h ../h/extern.h
comm.o:          ../h/defs.h ../h/struct.h ../h/extern.h
getsocket.o:     ../h/defs.h ../h/struct.h ../h/extern.h
init.o:          ../h/defs.h ../h/struct.h ../h/extern.h ../h/hallmap.h \
		../h/sunscreen.h ../h/sunscreen.h ../h/arrows.h \
		../h/wall_image.h
initplayer.o:    ../h/defs.h ../h/struct.h ../h/extern.h
ioctls.o:        ../h/defs.h ../h/struct.h ../h/extern.h
main.o:          ../h/defs.h ../h/struct.h ../h/data.h
packet.o:        ../h/defs.h ../h/struct.h ../h/extern.h
player.o:        ../h/defs.h ../h/sunscreen.h
prmaze.o:        ../h/defs.h ../h/struct.h
redraw.o:        ../h/sunscreen.h
send.o:          ../h/defs.h ../h/struct.h ../h/extern.h
service.o:       ../h/defs.h ../h/struct.h ../h/extern.h
setkeyok.o:      ../h/defs.h ../h/struct.h ../h/extern.h
statwin.o:       ../h/sunscreen.h
ualarm.o:        ../h/defs.h ../h/struct.h ../h/extern.h
viewwin.o:       ../h/sunscreen.h ../h/hallmap.h ../h/corners.h
wintext.o:       ../h/sunscreen.h
work.o:          ../h/defs.h ../h/struct.h ../h/extern.h
