# Makefile generated by imake - do not edit!
# $XConsortium: imake.c,v 1.37 88/10/08 20:08:30 jim Exp $

#
#  hextris Copyright 1990 David Markley, dm3e@+andrew.cmu.edu, dam@cs.cmu.edu
#
#  Permission to use, copy, modify, and distribute, this software and its
#  documentation for any purpose is hereby granted without fee, provided that
#  the above copyright notice appear in all copies and that both that
#  copyright notice and this permission notice appear in supporting
#  documentation, and that the name of the copyright holders be used in
#  advertising or publicity pertaining to distribution of the software with
#  specific, written prior permission, and that no fee is charged for further
#  distribution of this software, or any modifications thereof.  The copyright
#  holder make no representations about the suitability of this software for
#  any purpose.  It is provided "as is" without express or implied warranty.
#
#  THE COPYRIGHT HOLDER DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
#  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
#  EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
#  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
#  DATA, PROFITS, QPA OR GPA, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
#  OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
#  PERFORMANCE OF THIS SOFTWARE.
#

CC=cc

CFLAGS= -O
# Make sure INCLDS has the correct area(s) for the needed #includes
INCLDS= -I.
# Make sure LIBS has the correct area(s) for the needed libraries (-lX11).
LIBS= -L.
LOGGING=

# Make sure to change these same three variables in header.h

# Make this point to where you want the xhextris font placed.
HEXFONTDIR=./
# Make this point to where you want the high score file placed.
# Remember: This directory must be writable be another user, if you
# plan on keeping a common high score file.
HIGHSCOREDIR=./
# Make this the name of the high score file.
HIGHSCOREEXT=xhextris.scores

# This is where you want the binaries to be placed.
# Don't bother with the SECURE and UNPRIV, unless you have a setup where
# the game has to switch tokens to write the high scores. Send me mail if you
# do. The games maintainers at CMU have a good setup for this.
BIN=/tmp
SECURE=${BIN}
UNPRIV=${BIN}

DEFS= -DHEXFONTDIR="\"${HEXFONTDIR}/\"" -DHIGHSCOREDIR="\"${HIGHSCOREDIR}/\"" \
	-DHIGHSCOREEXT="\"${HIGHSCOREEXT}\""
.c.o:
	${CC} ${CFLAGS} ${DEFS} ${INCLDS} -c $*.c

all: installx installtop
	bdftosnf < hex10.bdf > ${HEXFONTDIR}/xhextris.snf
	mkfontdir ${HEXFONTDIR}
	echo "foo" > ${HIGHSCOREDIR}/${HIGHSCOREEXT}

xhextris : stdsys.o xio.o hextris.o header.h
	${CC} ${CFLAGS} ${DEFS} -o xhextris stdsys.o xio.o hextris.o \
	${INCLDS} ${AUTHLIBS} ${LIBS} -lX11 ${LOGGING}

# This is only usefull if you use the Andrew Window Manager
wmhextris: stdsys.o wmio.o hextris.o header.h
	${CC} ${CFLAGS} ${DEFS} -o wmhextris stdsys.o wmio.o hextris.o \
	${INCLDS} ${AUTHLIBS} ${LIBS} -lwm ${LOGGING}

tophextris: stdsys.o tophextris.o header.h
	${CC} -O ${DEFS} ${INCLDS} -o tophextris stdsys.o tophextris.o \
	${AUTHLIBS} ${LIBS}

installx: xhextris
	install -s xhextris ${SECURE}/xhextris

# This is only usefull if you use the Andrew Window Manager
installwm: wmhextris
	install -s wmhextris ${SECURE}/hextris

installtop: tophextris
	install -s tophextris ${UNPRIV}/tophextris

clean:
	-	rm *.o xhextris wmhextris hextris

xio.o: header.h
hextris.o: header.h
stdsys.o: header.h
tophextris.o: header.h

