#                  Mark's MUd Client
###########################################################################
# Set the following two paths.

# The location where winmmucl and xmmucl will be installed
BIN_DIR= /usr/local/bin

# Libraries, help files, etc are kept in a subdirectory of ROOT_DIR
# called mmucl.
ROOT_DIR= /usr/local/lib

###########################################################################
VERSION= 1.0b2
LIB_DIR= $(ROOT_DIR)/mmucl

install:	
	sed -e '1,27p' \
	    -e '28s%^.*%set Mmucl(lib_dir) $(LIB_DIR)%p' \
            -e '29s%^.*%set Mmucl(rc_dir) ~/.mmucl%p' \
	    -e '30,$$p' \
	    -n <./bin/xmmucl.tcl >$(BIN_DIR)/xmmucl

	sed -e '1,27p' \
	    -e '28s%^.*%set Mmucl(lib_dir) $(LIB_DIR)%p' \
            -e '29s%^.*%set Mmucl(rc_dir) ~/.mmucl%p' \
	    -e '30,$$p' \
	    -n <./bin/winmmucl.tcl >$(BIN_DIR)/winmmucl

	chmod 755 $(BIN_DIR)/xmmucl $(BIN_DIR)/winmmucl
	install -d $(LIB_DIR)/lib $(LIB_DIR)/html $(LIB_DIR)/icons
	install -m 0664 ./lib/* $(LIB_DIR)/lib
	install -m 0664 ./icons/* $(LIB_DIR)/icons
	install -m 0664 ./html/* $(LIB_DIR)/html
	echo "pkg_mkIndex $(LIB_DIR) $(LIB_DIR)/lib/*.tcl" | tclsh

tar:
	cd ..;tar cfvz mmucl$(VERSION).tar.gz mmucl$(VERSION)

zip:
	cd ..;zip -9r mmucl$(VERSION).zip mmucl$(VERSION)

clean:
	rm -f *~ bin/*~ examples/*~ html/*~ lib/*~ 

pkgIndex:
	echo "pkg_mkIndex . ./lib/*.tcl" | tclsh


