# $Id: Makefile,v 1.3 1993/04/06 05:28:20 sls Exp $
#
# Makefile to install tkinspect browser.
#

#
# X11LIB says how to link with the X11 xlib.
# X11INC says how to include the X11 includes (example, -I/usr/local/include).
#
X11LIB = -lX11
X11INC = 
CC = gcc
CFLAGS = 

#
# BINDIR says where to install the /bin/sh startup script.
#
BINDIR = /usr/local/bin

#
# LIBDIR tells us where to put the actual tcl scripts that make up
# tkinspect.  It should not be the current directory.  tkinspect wants
# this directory all to itself.
#
# WARNING: this Makefile will rm -rf LIBDIR, so it really does want
# the directory all to itself.
#
LIBDIR = /usr/local/lib/tkinspect

#
# WISH tells us where can we find the wish executable.  tkinspect
# requires Tk3.1 or greater.
#
WISH = /usr/local/bin/wish

#
# Hopefully you don't have to edit anything below this line.
#

default:
	@echo "Edit the Makefile and do make install to install tkinspect."

HLPFILES = File Intro Notes Options Patterns WhatsNew
TCLSRC = bindings.tcl class.tcl filechsr.tcl help.tcl tkinspect.tcl \
	dottkinspect

install: tkinspect.sh delinterp
	rm -f $(BINDIR)/tkinspect
	cp tkinspect.sh $(BINDIR)/tkinspect
	chmod a+rx $(BINDIR)/tkinspect
	rm -rf $(LIBDIR)
	mkdir $(LIBDIR)
	chmod a+rx $(LIBDIR)
	cp $(HLPFILES) $(LIBDIR)
	(cd $(LIBDIR); chmod a+r $(HLPFILES))
	cp $(TCLSRC) $(LIBDIR)
	(cd $(LIBDIR); chmod a+r $(TCLSRC))
	cp sls.xbm $(LIBDIR)
	chmod a+r $(LIBDIR)/sls.xbm
	cp delinterp $(LIBDIR)
	chmod a+rx $(LIBDIR)/delinterp

delinterp: delinterp.c
	$(CC) -o delinterp $(CFLAGS) $(X11INC) delinterp.c $(X11LIB)

tkinspect.sh:
	@echo \#!/bin/sh > tkinspect.sh
	@echo exec $(WISH) -f $(LIBDIR)/tkinspect.tcl $(LIBDIR) >> tkinspect.sh
	@chmod a+rx tkinspect.sh

clean:
	rm -f *~ delinterp

tar:
	tar cf tkinspect.tar README Makefile $(HLPFILES) $(TCLSRC) \
		delinterp.c README.class sls.xbm

shar:
	shar README Makefile $(HLPFILES) $(TCLSRC) delinterp.c \
		README.class sls.xbm > tkinspect.shar
