##############################################################################
# CONFIGURE -- set the names of where you want things installed, and where
# your copy of 'wish' resides.  When you run 'make install', it will rewrite
# tkpostage to use these paths.
##############################################################################

WISH   = /u/dwallach/packages/decstation/bin/wish
BINDIR = /u/dwallach/packages/tk
LIBDIR = /u/dwallach/lib/xbm
MANDIR = /u/dwallach/packages/shared/man
MANSECT = 1

##############################################################################
# that's all you should have to configure
##############################################################################

install:
	sed -e 's@^#!/usr/local/bin/wish -f@#!$(WISH) -f@' \
	    -e 's@^set bitmap "./Postage.xbm";@set bitmap "$(LIBDIR)/Postage.xbm";@' \
	    < tkpostage > $(BINDIR)/tkpostage
	chmod 755 $(BINDIR)/tkpostage
	cp tkpostage.man $(MANDIR)/man$(MANSECT)/tkpostage.$(MANSECT)
	cp Postage.xbm $(LIBDIR)/Postage.xbm


#
# stuff to make distributions easier
#
VERSION = tkpostage-1.3
SHAR = /usr/local/bin/shar -v -c -p X
SHARDIST = $(VERSION).shar
SHARFILES = README CHANGES Makefile tkpostage Postage.xbm tkpostage.man
TARDIST = $(VERSION).tar.Z
TARFILES = $(VERSION)/README $(VERSION)/CHANGES $(VERSION)/Makefile \
    $(VERSION)/tkpostage $(VERSION)/Postage.xbm $(VERSION)/tkpostage.man

dist: $(SHARDIST) $(TARDIST)

$(SHARDIST): $(SHARFILES)
	$(SHAR) $(SHARFILES) > $@

$(TARDIST): $(SHARFILES)
	cd ..; tar cf - $(TARFILES) | compress > $(VERSION)/$(VERSION).tar.Z
