# This is a cheap and dirty makefile for GSLIB; you'd think it would
# at least come with some README
all: 
	# if there's no bin directory, make one:
	if test -d bin; then echo bin; else mkdir bin; fi

	# need to make gslib first:
	cd gslib; make; cd ..

	cd addcoord; make; cd ..
	cd anneal; make; cd ..
	cd backtr; make; cd ..
	cd bicalib; make; cd ..
	cd bigaus; make; cd ..
	cd bin; make; cd ..
	cd bivplt; make; cd ..
	cd cokb3d; make; cd ..
	cd declus; make; cd ..
	cd draw; make; cd ..
	cd ellipsim; make; cd ..
	cd gam; make; cd ..
	cd gamv; make; cd ..
	cd gtsim; make; cd ..
	cd histplt; make; cd ..
	cd histsmth; make; cd ..
	cd ik3d; make; cd ..
	cd kb2d; make; cd ..
	cd kt3d; make; cd ..
	cd locmap; make; cd ..
	cd lusim; make; cd ..
	cd nscore; make; cd ..
	cd pfsim; make; cd ..
	cd pixelplt; make; cd ..
	cd postik; make; cd ..
	cd postsim; make; cd ..
	cd probplt; make; cd ..
	cd qpplt; make; cd ..
	cd rotcoord; make; cd ..
	cd sasim; make; cd ..
	cd scatplt; make; cd ..
	cd scatsmth; make; cd ..
	cd sgsim; make; cd ..
	cd sisim; make; cd ..
	cd trans; make; cd ..
	cd vargplt; make; cd ..
	cd varmap; make; cd ..
	cd vmodel; make; cd ..

clean:
	/bin/rm -f */*.o 
	/bin/rm -f */*.out
	/bin/rm -f */*.ps
	cd bin/; /bin/rm -f addcoord bivplt gam ik3d nscore probplt scatsmth varmap anneal cokb3d gamv kb2d pfsim qpplt sgsim vmodel backtr declus gtsim kt3d pixelplt rotcoord sisim bicalib draw histplt locmap postik sasim trans bigaus ellipsim histsmth lusim postsim scatplt vargplt


examples:
	cd addcoord; ../bin/addcoord<addcoord.par; cd ..
	cd backtr; ../bin/backtr<backtr.par; cd ..
	cd bicalib; ../bin/bicalib<bicalib.par; cd ..
	cd bigaus; ../bin/bigaus<bigaus.par; cd ..
	cd declus; ../bin/declus<declus.par; cd ..
	cd draw; ../bin/draw<draw.par; cd ..
	cd ellipsim; ../bin/ellipsim<ellipsim.par; cd ..
	cd gam; ../bin/gam<gam.par; cd ..
	cd gamv; ../bin/gamv<gamv.par; cd ..
	cd histplt; ../bin/histplt<histplt.par; cd ..
	cd histsmth; ../bin/histsmth<histsmth.par; cd ..
	cd ik3d; ../bin/ik3d<ik3d.par; cd ..
	cd kb2d; ../bin/kb2d<kb2d.par; cd ..
	cd kt3d; ../bin/kt3d<kt3d.par; cd ..
	cd locmap; ../bin/locmap<locmap.par; cd ..
	cd lusim; ../bin/lusim<lusim.par; cd ..
	cd nscore; ../bin/nscore<nscore.par; cd ..
	cd pixelplt; ../bin/pixelplt<pixelplt.par; cd ..
	cd postik; ../bin/postik<postik.par; cd ..
	cd probplt; ../bin/probplt<probplt.par; cd ..
	cd qpplt; ../bin/qpplt<qpplt.par; cd ..
	cd rotcoord; ../bin/rotcoord<rotcoord.par; cd ..
	cd sasim; ../bin/sasim<sasim.par; cd ..
	cd scatplt; ../bin/scatplt<scatplt.par; cd ..
	cd scatsmth; ../bin/scatsmth<scatsmth.par; cd ..
	cd sgsim; ../bin/sgsim<sgsim.par; cd ..
	cd sisim; ../bin/sisim<sisim.par; cd ..
	cd trans; ../bin/trans<trans.par; cd ..
	cd varmap; ../bin/varmap<varmap.par; cd ..
	cd vmodel; ../bin/vmodel<vmodel.par; cd ..

	# special problem files: need to be run after others:
	cd bivplt; cp -r ../scatsmth/scatsmth.out .; ../bin/bivplt<bivplt.par; cd ..

	cd anneal; cp -f ../sisim/sisim.out .; cp -f ../ellipsim/ellipsim.out .;../bin/anneal<anneal.par; cd ..

	cd postsim; cp -r ../sgsim/sgsim.out . ../bin/postsim<postsim.par; cd ..

	cd gtsim; cp -r ../sgsim/sgsim.out .;../bin/gtsim<gtsim.par; cd ..

	# I concocted a par file for this one, it it's was empty:
	cd vargplt; cp -f ../vmodel/vmodel.var .; ../bin/vargplt<vmodel.par; cd ..

	# these two still don't work:

	# STOP:  Too few columns in input data file
	cd pfsim; cp -r ../sgsim/sgsim.out .;  cp -r ../ik3d/ik3d.out .;../bin/pfsim<pfsim.par; cd ..

	#  ERROR data file somedata.dat does not exist!
	cd cokb3d; ../bin/cokb3d<cokb3d.par; cd ..
