DESTDIR=
SERVDIR = /usr/local/games/gameserver
# It's possible that the game data file will reside in a different
# location on the server than it will for the clients who are using it.
# LIBDIR is the server location, GAME_DATA_DIR is the client location.
LIBDIR = ${SERVDIR}/lib
GAME_DATA_DIR= /mit/sipb/lib/gameserver
GAME_DATA= netgames
CFLAGS= -DGAME_DATA_FILE=\"${GAME_DATA_DIR}/${GAME_DATA}\"\
	-DSRV_DATA_FILE=\"${LIBDIR}/${GAME_DATA}\"

SRVOBJ = game_data.o gameserver.o safe_read.o
SRVSRC = game_data.c gameserver.c safe_read.c
SRVINC = game_data.h messagecodes.h user.h

all: gameserver netgames

# Installing the stuff on the server machine is not part of the
# default install because it won't be done very often and should be done
# by hand rather than just a "make install".

install: game_data_install

srv_install: gameserver
	install -c -s gameserver ${DESTDIR}${SERVDIR}

srv_data_install: ${GAME_DATA}
	-mkdir ${DESTDIR}${LIBDIR}
	install -c ${GAME_DATA} ${DESTDIR}${LIBDIR}/${GAME_DATA}

game_data_install: ${GAME_DATA}
	-mkdir ${DESTDIR}${GAME_DATA_DIR}
	install -c ${GAME_DATA} ${DESTDIR}${GAME_DATA_DIR}/${GAME_DATA}

gameserver: ${SRVOBJ}
	cc ${CFLAGS} ${EXFLAGS} -o gameserver ${SRVOBJ}

depend: ${SRVINC}
	makedepend -v ${CFLAGS} -s'# DO NOT DELETE' ${SRVSRC}

clean:
	-rm -f *.o gameserver *~ *.bak

.c.o:
	cc -c ${CFLAGS} ${EXFLAGS} $*.c

# DO NOT DELETE THIS LINE AND DON'T PUT ANYTHING AFTER IT
