SHELL    	= /bin/sh
LINK_VERSION 	= 1.2
#############################################################################
#  Instructions:  Set the following macros, then run "make install" in this
#		  directory.  **Inform your users** to set the following 
#		  environment variables (replace $(LIBDIR) with your choice
#		  for it below):
#			STK_LIBRARY   $(LIBDIR)/LINK/1.2
#			STK_LOAD_PATH $(LIBDIR)/LINK/1.2/stklos)
#
#  The executable will be called "Link"
#############################################################################
ROOT 		= <this directory>

BINDIR   	= <where to put a symbolic link called "Link">
#	   	  (suggestion:  /usr/local/bin)

LIBDIR   	= <where to put the libraries and executable versions>
#	   	  (suggestion:  /usr/local/lib)
#######################################################################

VERSIONDIR	= $(LIBDIR)/LINK/$(LINK_VERSION)

install:
	if [ ! -d $(BINDIR) ]; \
	then \
		mkdir -p $(BINDIR); \
	fi
	if [ ! -d $(VERSIONDIR) ]; \
	then \
		mkdir -p $(VERSIONDIR); \
	fi
	if [ ! -d $(VERSIONDIR)/STk ]; \
	then \
		mkdir -p $(VERSIONDIR)/STk; \
	fi
	if [ ! -d $(VERSIONDIR)/stklos ]; \
	then \
		mkdir -p $(VERSIONDIR)/stklos; \
	fi
	- rm -f $(BINDIR)/Link
	- mv $(ROOT)/Link $(VERSIONDIR)/Link-$(LINK_VERSION)
	- ln -s $(VERSIONDIR)/Link-$(LINK_VERSION) $(BINDIR)/Link 
	- cp -R $(ROOT)/STk/* $(VERSIONDIR)/STk
	- cp -R $(ROOT)/stklos/* $(VERSIONDIR)/stklos
