# $Id: Makefile,v 1.1 1993/03/12 02:28:10 sls Exp $
#
# Makefile to install pixmap editor.
#

#
# BINDIR says where to install the pixmap /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/pixmap

#
# MANDIR tells us where to install the man page.
#
MANDIR = /usr/local/man/man1

#
# WISH tells us where can we find the wish executable.  Pixmap
# 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 pixmap."

install: pixmap.sh
	rm -f $(BINDIR)/pixmap
	cp pixmap.sh $(BINDIR)/pixmap
	chmod a+rx $(BINDIR)/pixmap
	if test ! -d $(LIBDIR); then rm -rf $(LIBDIR); mkdir $(LIBDIR); fi
	chmod a+rx $(LIBDIR)
	rm -f $(LIBDIR)/default.pal
	cp default.pal $(LIBDIR)
	rm -f $(LIBDIR)/pixmap.tcl
	cp pixmap.tcl $(LIBDIR)
	rm -f $(LIBDIR)/class.tcl
	cp class.tcl $(LIBDIR)
	chmod a+r $(LIBDIR)/default.pal $(LIBDIR)/pixmap.tcl
	chmod a+r $(LIBDIR)/class.tcl
	rm -rf $(MANDIR)/pixmap.1
	cp pixmap.1 $(MANDIR)
	chmod a+r $(MANDIR)/pixmap.1

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