# $Id: Makefile,v 1.1 1993/03/28 02:15:15 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
# pixmap.  It should not be the current directory.
#
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."

install: tkinspect.sh delinterp
	rm -f $(BINDIR)/tkinspect
	cp tkinspect.sh $(BINDIR)/tkinspect
	chmod a+rx $(BINDIR)/tkinspect
	if test ! -d $(LIBDIR); then rm -rf $(LIBDIR); mkdir $(LIBDIR); fi
	chmod a+rx $(LIBDIR)
	rm -f $(LIBDIR)/tkinspect.tcl
	cp tkinspect.tcl $(LIBDIR)
	chmod a+r $(LIBDIR)/tkinspect.tcl
	rm -f $(LIBDIR)/class.tcl
	cp class.tcl $(LIBDIR)
	chmod a+r $(LIBDIR)/class.tcl
	rm -f $(LIBDIR)/bindings.tcl
	cp bindings.tcl $(LIBDIR)
	chmod a+r $(LIBDIR)/bindings.tcl
	rm -f $(LIBDIR)/filechsr.tcl
	cp filechsr.tcl $(LIBDIR)
	chmod a+r $(LIBDIR)/filechsr.tcl
	rm -f $(LIBDIR)/delinterp
	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
