# Makefile file for WebOOGL source installation
# <http://www.geom.umn.edu/locate/weboogl/>

########################################################################
# Note that the source distribution is currently only useful in
# conjunction with one of the binary versions, since a critical part
# of the package (Geomview 1.5.1) hasn't been released as source yet.
# We provide the source for those who'd like to see what's going on,
# not so that you can compile it for machines other than the SGI or
# Sun.
########################################################################

########################################################################
# Variables to change if necessary
########################################################################

# set CPU to "sgi" or "sun4"
CPU = sgi

# Place to install the programs. The directory needs to be in the
# user's path. If you want to just keep the programs in this
# directory, you must provide a full pathname: 
# don't use "." to mean the current directory.

INSTALLDIR=/usr/local/bin

# The perl binary on your system. 
# It's "/usr/sbin/perl" by default on Irix 5.x systems.
PERLPATH=/usr/local/bin/perl

# Change this if you've installed libwww-perl elsewhere.
LIBWWWPATH=/usr/local/lib/libwww-perl-0.40

# Change if necessary for your local system; this is the directory
# for files like sys/socket.ph. 
LOCALLIB=/usr/local/lib/perl

########################################################################
# Code that shouldn't need to change
########################################################################


PERLSCRIPTS = weboogl.perl to-weboogl.perl gvgeturl.perl 
SCRIPTS = $(PERLSCRIPTS)
PROGS = vrml2oogl woogl2oogl 
CLIENTS = $(SCRIPTS) $(PROGS)
CP = /bin/cp

all:	scripts progs

scripts:
	$(PERLPATH) -pi.orig -e 's#/usr/local/bin/perl#$(PERLPATH)#o' $(PERLSCRIPTS)
	$(PERLPATH) -pi.orig -e 's#/usr/local/lib/libwww-perl-0.40#$(LIBWWWPATH)#o' gvgeturl.perl
	$(PERLPATH) -pi.orig -e 's#/usr/local/lib/perl#$(LOCALLIB)#o' gvgeturl.perl
	chmod 755 $(SCRIPTS)
	$(CP) $(SCRIPTS) $(INSTALLDIR)


progs:
	cd vrml2oogl.src/src; \
	  make -f Makefile.$(CPU)
	cd vrml2oogl.src/test; \
	  make -f Makefile.$(CPU); \
	  $(CP) vrml2oogl $(INSTALLDIR); \
	  chmod 755 $(INSTALLDIR)/vrml2oogl
	cd woogl2oogl.src; \
	  gmake -f Makefile.$(CPU); \
	  $(CP) woogl2oogl $(INSTALLDIR); \
	  chmod 755 $(INSTALLDIR)/woogl2oogl
