#
# Copyright (C) 1998-2000 Etymon Systems, Inc. <http://www.etymon.com/>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
# USA.
#

prefix=/usr
bindir=$(prefix)/bin
mandir=$(prefix)/man

all:
	@echo "Use 'make install' or 'make install prefix=...' to install."
	@echo "Note: 'make install' is equivalent to 'make install prefix=/usr'."

pjscript:
	echo '#!/bin/sh' > pjscript
	echo 'java -classpath $$CLASSPATH:$(bindir)/pj.jar com.etymon.pj.tools.PjScript $$*' >> pjscript
	chmod +x pjscript

install:
	make pjscript
	install -m 644 pj.jar $(bindir)/.
	install pjscript $(bindir)/.
	install -m 644 doc/pjscript.man $(mandir)/man1/pjscript.1
	@echo "**********************************************************************"
	@echo "You may need to add '$(bindir)/pj.jar' to your CLASSPATH."
	@echo "If you use bash, you can type:"
	@echo "        " CLASSPATH="$$"CLASSPATH:$(bindir)/pj.jar "; export CLASSPATH"
	@echo "Type 'man pjscript' for scripting documentation."
	@echo "See javadoc/ in this directory for Java documentation."
	@echo "**********************************************************************"
