makefile:
	@echo use "make sgi" "make hp" or "make linux" to select a platform
	@echo ... or else create Make.inc and then use "make all"

sgi: cpsgi all

cpsgi::
	cp  Make_R4000  Make.inc

linux: cplinux all 

cplinux::
	cp Make_linux Make.inc

cross: cpcross all 

cpcross::
	cp Make_osx_to_win Make.inc


hp: cphp all

cphp::
	cp Make_HP Make.inc


all: encode pdf2 logic

test::
	cd test; \
	make

encode::
	cd encode; \
	make

pdf2::
	cd pdf2; \
	make 

# replaced with encode/encode.tcl script
#create the index files from the CDROM and then create the initialization file
#install:: 
#	@echo "Writing output files in ${OUTDIR}"
#	@echo 
#	cp pdf2/*.tbl ${OUTDIR}
#	cp pdf2/copynot.txt .
#	#cd encode; encode.unix &
#	xterm -e /bin/sh -c "cd encode; ./encode.unix; echo Press return; read x" &
#	-cp files.loc ${HOME}/.powder_suite
#	-cp files.loc /usr/local/powder_suite.txt
#	@echo "**********************************************"
#	@echo "Attempt to install logic as a loadable package"
#	@echo "**********************************************"
#	-mkdir $(PKGDIR)/logic
#	-cp pkgIndex.tcl $(PKGDIR)/logic/
#	-cp logic.so $(PKGDIR)/logic/

logic::
	cd srclogic; \
	make

#logic: logic.tcl
#	@echo "#!`pwd`/tk_logic" > logic
#	@echo "# the previous lines should agree with the location of the program" >> logic
#	@echo "# or use wish <path/>logic to use the shared library file" >> logic
#	@cat logic.tcl >> logic
#	chmod +x logic

clean::
#	cd test; make clean
	cd srclogic; make clean
	cd encode; make clean
	cd pdf2; make clean
	-rm -f *~
	-rm -f lastaids.rec


distclean:: clean
	cd srclogic; make distclean
	cd encode; make distclean
	cd pdf2; make distclean
	-rm -f logic
	-rm -f distrib.dat
	-rm -rf ./testdata Make.inc
	-rm -rf indexfiles
	-rm -f powder_suite.tar*

tar:: clean
	date > distrib.dat
	tar cvf ../powder_suite.tar encode pdf2 srclogic test websearch *.tcl Make* INST* *.bat distrib.dat change.log logic.html win95.notes
	mv ../powder_suite.tar .
	gzip -v powder_suite.tar

zip::
	zip logic_win95_bin */*.tbl mktestdata.bat encode/encode.bat encode/*.in *.tcl test/pdf2.dat win95.notes
	cd ../logic_win; zip ../logic/logic_win95_bin *.exe */*.exe 

# replaced with encode/encode.tcl script
#testdata:: 
#	-mkdir ./testdata
#	@echo `pwd`/testdata/ > files.loc
#	@echo `pwd`/test/ >> files.loc
#	@echo `pwd`/testdata/ >> files.loc
#	@echo "Writing output files in `pwd`/testdata/"
#	@echo 
#	cp pdf2/*.tbl `pwd`/testdata/
#	xterm -e /bin/sh -c "cd encode; ./encode.unix; echo Press return; read x" &
#	-cp files.loc ${HOME}/.powder_suite
#	-cp files.loc /usr/local/powder_suite.txt
#	-rm -f copynot.txt
