CCL Home Page
Up Directory CCL makefile
#Makefile for installation of GIFA

SHELL = /bin/sh
GIFA_DEF = gifa_med

# Remarque, this will fail on MachTen, because it lacks uname.
# To have it work, create a shell script called uname (in /usr/local/bin
# for instance), which contains :

# echo MachTen

# that will fix it

ARCHI = -@archi="`uname`"; \
	echo "for $$archi"; \
	if [ $$archi = "HP-UX" ] ; then \
		kit=gifav4_HPUX.tar.Z; \
	elif [ $$archi = "IRIX" ] ; then \
		cpu="`uname -m`"; \
		if [ $$cpu = "IP6" -o $$cpu = "IP10" -o $$cpu = "IP12" -o $$cpu = "IP14" ] ; then \
			echo "R3000"; \
			kit=gifav4_SGI3000.tar.Z; \
		else \
			echo "R4000"; \
			kit=gifav4_SGI.tar.Z; \
		fi; \
	elif [ $$archi = "IRIX64" ] ; then \
		kit=gifav4_SGI64.tar.Z; \
	elif [ $$archi = "MachTen" ] ; then \
		kit=gifav4_MachTen-Mac.tar.Z; \
	elif [ $$archi = "AIX" ] ; then \
		kit=gifav4_RS6000.tar.Z; \
	elif [ $$archi = "SunOS" ] ; then \
		release="`uname -r|cut -d . -f 1`"; \
		if [ $$release = "5" ] ; then \
			echo "Solaris 2.`uname -r|cut -d . -f 2`"; \
			kit=gifav4_SOL2.tar.Z; \
		else \
			echo "`uname -s -r`"; \
			kit=gifav4_SUN.tar.Z; \
		fi; \
	elif [ $$archi = "mips" ] ; then \
		kit=gifav4_MIPS.tar.Z; \
	elif [ $$archi = "Linux" ] ; then \
		echo "`uname -s -r`"; \
		kit=gifav4_LINUX.tar.Z; \


	else echo "Platform unknown"; exit 1 ; \
	fi;


default :
	@echo "  Several choices : "
	@echo
	@echo "   make unpack          unpack the gifa_XXX.tar.Z files,"
	@echo "   make verify          verify that distribution is complete"
	@echo "   make test_gifa       run tests on gifa"
	@echo "                        be carefull, will create ~ 6MegaByte on /usr/tmp"
	@echo "   make install         install gifa on your machine"
	@echo "                        you might have to be root for this."
	@echo "   make Bruker_install  install some utilities for UX-NMR"
	@echo
	@echo "	You should probably do these commands in sequence"

unpack :
	@echo "unpacking binaries..."
	$(ARCHI) \
	cat $$kit | uncompress -c | tar xf -
	@chmod 755 bin/*
	@echo " ...done"
	@echo " The following version of Gifa are present in the kit :"
	@echo
	@/bin/ls bin/gifa_*
	@echo
	@echo "If different versions are present, they correspond to different buffer size"
	@echo "depending on the size of your machine (memory, swap space), you may want"
	@echo "to choose a different version than the default one, which is $(GIFA_DEF)"
	@echo "(see README_2)"
	@echo
	cp bin/$(GIFA_DEF) bin/gifa
	@echo
	@echo "unpacking basic..."
	@zcat gifav4_basic.tar.Z | tar xf -
	@echo " ...done"
	@echo
	@if [ -s gifav4_data.tar.Z ] ; then \
		echo "unpacking data..."; \
		zcat gifav4_data.tar.Z | tar xf - ; \
		echo " ...done" ; \
	fi
	@echo " Unpacking successful."

verify :
	@echo " Checking if all the files are here..."
	@cat List_of_files | split -100
	@rm -f missing
	-@for filelist in x??; do \
 	   (ls `cat $$filelist` >/dev/null 2>>missing) \
	done
	@if [ -s missing ] ; then \
	    echo "WARNING - the following files are missing:" ; \
	    cat missing ; \
	    echo ; \
	    echo "If you did not ftp the gifav4_data.tar.Z, then all the data/* files are missing" ; \
	    echo "It is Ok, unless you want to use the test_gifa utility" ; \
	    echo "In which case, expect the ft_base test to fail (no big deal ;-)" ; \
	else \
    	    echo "...Looks good"; \
	fi
	@echo
	@rm -f missing x??


#test Gifa by running the standard test
test_gifa : 
	(cd test ; ../bin/gifa) 

#for installing gifa on that machine
install :
	@echo "Creating directories..."
	-if [ ! -d /usr/local ] ; then \
		mkdir /usr/local; chmod a+r /usr/local; \
	fi
	-if [ ! -d /usr/local/gifa ] ; then \
		ln -s `pwd` /usr/local/gifa; chmod a+r /usr/local/gifa; \
	fi
	-if [ ! -d /usr/local/bin ] ; then \
		mkdir /usr/local/bin; chmod a+r /usr/local/bin;\
	fi
	@echo "...Done"
	$(ARCHI)
	@echo "Copying Gifa....."
	cp bin/gifa /usr/local/bin/gifa
	strip /usr/local/bin/gifa
	@echo "...Done"
	@echo
	@echo "When getting used to Gifa, you may wish to remove the gifa_* in ./bin"
	@echo "These files can be very big on certain machines."
	@echo "(see README_2)"
	@echo
	@echo "Copying utilities ....."
	cp com/gifaplot /usr/local/bin
	cp com/gifaprint /usr/local/bin
	@echo "Do not forget to adapt those 2 shell scripts for your set-up"
	@echo
	cp com/XMgifa /usr/lib/X11/app-defaults
	@echo "you may adapt this last one if you don't like the way it looks ;-)"
	@echo "...Done"
	@echo
	@echo "Installation Successful."
	@echo "gifa is now in /usr/local/bin"
	@echo "to use it, add /usr/local/bin to your PATH"
	@echo
	@echo "Do not forget to get a valid licence (see README)"

Bruker_install :
	@echo "Copying a set of commands for getting Bruker/UXNMR files...."
	@echo "(Varian does not need special utility, just use the READV command)"
	cp bin/ux2cach /usr/local/bin
	cp util/ux2cache/ux2cach.sh /usr/local/bin
	cp util/get/* /usr/local/bin
	@echo "...Done"
	@echo "Installation Successful."


Modified: Wed Jan 24 17:00:00 1996 GMT
Page accessed 4175 times since Sat Apr 17 22:03:29 1999 GMT