#
# Makefile for sb
#
# Tom Phelps (phelps@cs.Berkeley.EDU)
#


### you need to localize the paths on these lines

WISH = /usr/sww/X11/bin/wish-3.3b2
LIBDIR = /home/yew/yew5/users/phelps/lib
BINDIR = /home/yew/yew5/users/phelps/bin


### these lines are probably fine

INSTALL = install


#--------------------------------------------------
#
# you shouldn't modify anything below here
#
#--------------------------------------------------

version = 1.0
srcs = sb.tcl
objs = sb
libs = searchbox.tcl taputils.tcl
aux = README-sb Makefile
bitmaps = 
distrib = $(srcs) $(libs) $(bitmaps) $(aux)


all: sb

sb: sb.tcl $(libs)
	echo '#!$(WISH) -f' > sb
	echo 'set sbx(lib) $(LIBDIR)' >> sb
	echo 'set sbx(version) $(version)' >> sb
	egrep -v '^[ \t]*#' sb.tcl >> sb
	chmod +x sb

install: sb bs2tk
	$(INSTALL) -c $(libs) $(LIBDIR)
	$(INSTALL) -c sb $(BINDIR)

test: sb
	cp sb $(BINDIR)
	cp $(libs) $(LIBDIR)
	sb -debug

clean:
	rm -f $(objs)

tar:
	rm -f searchbox*.tar.{gz,z,Z}*
	mkdir searchbox-$(version)
	cp -R $(distrib) searchbox-$(version)
	gtar chvf searchbox-$(version).tar searchbox-$(version)
	compress searchbox-$(version).tar
#	gzip -9v searchbox-$(version).tar
	rm -rf searchbox-$(version)
	@echo "*** Did you remember to ci -l first?"

uu: tar
#	gznew searchbox-$(version).tar.Z
	uuencode searchbox-$(version).tar.Z searchbox-$(version).tar.Z > searchbox-$(version).tar.Z.uu
