#
# Makefile for xibc - the Internet Backgammon Expectk Client
# written by Jesper Blommaskog
# d9jesper@cd.chalmers.se
#
# Note - Tcl, Tk and Expect are required - read comp.lang.tcl for 
# instructions on installing them.

# Where is expectk?

expectk =

# Where shall I put the bitmaps?
# The application cannot be run unless bitmaps are installed.
# Therefore, the current directory is default. 

# bitmapdir =
bitmapdir:sh =pwd

# What to call the application (xibc)?

xibc = xibc

# Where to put the application?

bindir =/usr/local/bin

# What username to use with install?
# The default is the installers name.

username:sh =whoami

# What group to use with install?

group =

# What masks to use with install?

execmask =0755
readmask =0664

# What installcommand to use?

execinstall =install -g ${group} -m ${execmask} -o ${username}
readinstall =insatll -g ${group} -m ${readmask} -o ${username}

DOUBLES = d1.bm d2.bm d4.bm d8.bm d16.bm d32.bm d64.bm
DICE = dice.bm roll.bm r1.bm r2.bm r3.bm r4.bm r5.bm r6.bm
BITMAPS = ${DOUBLES} ${DICE}

.SUFFIXES: .bm

# Targets

all:	${xibc}

${xibc}:
	@echo "#!${expectk} " > ${xibc}
	@echo "set bitmapdir ${bitmapdir}" >> ${xibc}
	cat main >> ${xibc}
	chmod a+x ${xibc}
	@echo --- make install will install binary and bitmaps ---

install:	bitmaps bin
	@echo --- Install complete. ---

bin:	
	${execinstall} ${xibc} ${bindir}/${xibc}
	@echo --- ${xibc} installed. ---

bitmaps:	${BITMAPS}
	@echo --- Bitmaps installed. ---

${bitmapdir}/%.bm:	%.bm
	${readinstall} $*.bm ${bitmapdir}
