# this is a very simple Makefile for installation of xelem.
XELEM_VERSION = 1.21
XELEM = xelem-$(XELEM_VERSION)

# The wish executable: should have the BLT widget linked in if you want nice plots
WISH = /usr/bin/X11/blt_wish

# Directories for scripts/binaries and for bitmaps; 
BINDIR = /usr/local/bin
BITMAPDIR = /usr/local/lib/bitmaps
SRCDIR = /usr/local/lib/tk

# Mail command line options: -s "About_Xelem..." on BSD systems, nothing on SYSV
MAILOPT = -s "About Xelem..."
#MAILOPT = 

# The install program. Default  'install' would work except on IRIX, where bsdinst should be used
INSTALL = install -c

default:
	@echo "Edit the Makefile and type 'make install' to install xelem"

install:
	sed -e 's.^#\!/usr/local/bin/blt_wish.#\!$(WISH).' < xelem   | \
	sed -e 's./usr/local/lib/bitmaps.$(BITMAPDIR).'              | \
	sed -e 's./usr/local/lib/tk.$(SRCDIR).'                      | \
	sed -e 's:-s "About Xelem...":$(MAILOPT):'   > xelem.temporary
	$(INSTALL) -m 755 xelem.temporary $(BINDIR)/xelem
	rm -f xelem.temporary
	$(INSTALL) -m 644 xelem.xbm $(BITMAPDIR)
	$(INSTALL) -m 644 features.tcl $(SRCDIR)

# this assumes that xelem files are in directory ...../xelem-$(XELEM_VERSION)
distribution:
	(cd ..;tar -cvf $(XELEM)/$(XELEM).tar $(XELEM)/{README,INSTALL,Makefile,xelem,xelem.xbm,features.tcl,example.xelemrc})
