#
# Makefile for processing GUI
#

all:
	@ echo "Use one of the following:"
	@ echo "make sgi"
	@ echo "make alpha"
	@ echo "make linux"
	@ echo
	@ echo "make clean"
sgi:
	if ( ! -e ../bin) mkdir ../bin
	cp process ../bin
	cp stop_gui ../bin
	cp kill_awk ../bin
	if ( ! -e ../lib) mkdir ../lib
	@ echo "Making gui_lib"  
	cd gui_lib; make -f Makefile.sgi
	@ echo "Making purdue"  
	cd purdue; make -f Makefile.sgi
	@ echo "Making DPS routines"  
	cd dps/util; make -f Makefile.sgi
	cd dps/index; make -f Makefile.sgi
	cd dps/bravais; make -f Makefile.sgi
	cd dps/peak_search; make -f Makefile.sgi
	@ echo "Making GUI routines"  
	cd gui_dialogs/dpa_dialog; make -f Makefile.sgi
	cd gui_dialogs/dpg_dialog; make -f Makefile.sgi
	cd gui_dialogs/mc_dialog; make -f Makefile.sgi
	cd gui_dialogs/mm_dialog; make -f Makefile.sgi
	cd gui_dialogs/ref_dialog; make -f Makefile.sgi
	cd gui_dialogs/ucell_dialog; make -f Makefile.sgi
	cd gui_dialogs/processing_gui; make -f Makefile.sgi
	cd gui_dialogs/lft; make -f Makefile.sgi
	@ echo "Making addf"  
	cd addf; make -f Makefile.sgi
	@ echo "Making addi"  
	cd addi; make -f Makefile.sgi
	@ echo "Making adxv2dps_coord"  
	cd adxv2dps_coord; make -f Makefile.sgi
	@ echo "Making adxv2mos_coord"  
	cd adxv2mos_coord; make -f Makefile.sgi
	@ echo "Making bravais_to_mosflm"  
	cd bravais_to_mosflm; make -f Makefile.sgi
	cd cell_constrain; make -f Makefile.sgi
	@ echo "Making check_filenames"  
	cd check_filenames; make -f Makefile.sgi
	@ echo "Making condense_bravais"  
	cd condense_bravais; make -f Makefile.sgi
	@ echo "Making divf"  
	cd divf; make -f Makefile.sgi
	@ echo "Making end_imno"  
	cd end_imno; make -f Makefile.sgi
	@ echo "Making extract_refine_items"  
	cd extract_refine_items; make -f Makefile.sgi
	@ echo "Making gdb_from_sav"  
	cd gdb_from_sav; make -f Makefile.sgi
	@ echo "Making get_gdb"  
	cd get_gdb; make -f Makefile.sgi
	@ echo "Making make_3digit"  
	cd make_3digit; make -f Makefile.sgi
	@ echo "Making mh_st"  
	cd mh_st; make -f Makefile.sgi
	@ echo "Making mos2adxv_mm"  
	cd mos2adxv_mm; make -f Makefile.sgi
	@ echo "Making mos2dps_coord"  
	cd mos2dps_coord; make -f Makefile.sgi
	@ echo "Making mosflm_partition"  
	cd mosflm_partition; make -f Makefile.sgi
	@ echo "Making mtz2various_cn"  
	cd mtz2various_cn; make -f Makefile.sgi
	@ echo "Making postchk"  
	cd postchk; make -f Makefile.sgi
	@ echo "Making put_gdb"  
	cd put_gdb; make -f Makefile.sgi
	@ echo "Making subf"  
	cd subf; make -f Makefile.sgi
	@ echo "Making subi"  
	cd subi; make -f Makefile.sgi
	@ echo "Making system_from_info"  
	cd system_from_info; make -f Makefile.sgi
	@ echo "Making mosflm"  
	cd mosflm; make -f Makefile.sgi
	@ echo "Done"  

alpha: 
#	if (test ! -e ../bin) then
	  mkdir ../bin
#	fi
	cp process ../bin
	cp stop_gui ../bin
	cp kill_awk ../bin
#	if (test ! -e ../lib) then
	  mkdir ../lib
#	fi
	@ echo "Making gui_lib"  
	cd gui_lib; make -f Makefile.alpha
	@ echo "Making purdue"  
	cd purdue; make -f Makefile.alpha
	@ echo "Making DPS routines"  
	cd dps/util; make -f Makefile.alpha
	cd dps/index; make -f Makefile.alpha
	cd dps/bravais; make -f Makefile.alpha
	cd dps/peak_search; make -f Makefile.alpha
	@ echo "Making GUI routines"  
	cd gui_dialogs/dpa_dialog; make -f Makefile.alpha
	cd gui_dialogs/dpg_dialog; make -f Makefile.alpha
	cd gui_dialogs/mc_dialog; make -f Makefile.alpha
	cd gui_dialogs/mm_dialog; make -f Makefile.alpha
	cd gui_dialogs/ref_dialog; make -f Makefile.alpha
	cd gui_dialogs/ucell_dialog; make -f Makefile.alpha
	cd gui_dialogs/processing_gui; make -f Makefile.alpha
	cd gui_dialogs/lft; make -f Makefile.alpha
	@ echo "Making addf"  
	cd addf; make -f Makefile.alpha
	@ echo "Making addi"  
	cd addi; make -f Makefile.alpha
	@ echo "Making adxv2dps_coord"  
	cd adxv2dps_coord; make -f Makefile.alpha
	@ echo "Making adxv2mos_coord"  
	cd adxv2mos_coord; make -f Makefile.alpha
	@ echo "Making bravais_to_mosflm"  
	cd bravais_to_mosflm; make -f Makefile.alpha
	cd cell_constrain; make -f Makefile.alpha
	@ echo "Making check_filenames"  
	cd check_filenames; make -f Makefile.alpha
	@ echo "Making condense_bravais"  
	cd condense_bravais; make -f Makefile.alpha
	@ echo "Making divf"  
	cd divf; make -f Makefile.alpha
	@ echo "Making end_imno"  
	cd end_imno; make -f Makefile.alpha
	@ echo "Making extract_refine_items"  
	cd extract_refine_items; make -f Makefile.alpha
	@ echo "Making gdb_from_sav"  
	cd gdb_from_sav; make -f Makefile.alpha
	@ echo "Making get_gdb"  
	cd get_gdb; make -f Makefile.alpha
	@ echo "Making make_3digit"  
	cd make_3digit; make -f Makefile.alpha
	@ echo "Making mh_st"  
	cd mh_st; make -f Makefile.alpha
	@ echo "Making mos2adxv_mm"  
	cd mos2adxv_mm; make -f Makefile.sgi
	@ echo "Making mos2dps_coord"  
	cd mos2dps_coord; make -f Makefile.alpha
	@ echo "Making mosflm_partition"  
	cd mosflm_partition; make -f Makefile.alpha
	@ echo "Making mtz2various_cn"  
	cd mtz2various_cn; make -f Makefile.alpha
	@ echo "Making postchk"  
	cd postchk; make -f Makefile.alpha
	@ echo "Making put_gdb"  
	cd put_gdb; make -f Makefile.alpha
	@ echo "Making subf"  
	cd subf; make -f Makefile.alpha
	@ echo "Making subi"  
	cd subi; make -f Makefile.alpha
	@ echo "Making system_from_info"  
	cd system_from_info; make -f Makefile.alpha
	@ echo "Making mosflm"  
	cd mosflm; make -f Makefile.alpha
	@ echo "Done"  

linux: 
#	if ( ! -e ../bin) mkdir ../bin
	cp process ../bin
	cp stop_gui ../bin
	cp kill_awk ../bin
#	if ( ! -e ../lib) mkdir ../lib
	@ echo "Making gui_lib"  
	cd gui_lib; make -f Makefile.linux
	@ echo "Making purdue"  
	cd purdue; make -f Makefile.linux
	@ echo "Making DPS routines"  
	cd dps/util; make -f Makefile.linux
	cd dps/index; make -f Makefile.linux
	cd dps/bravais; make -f Makefile.linux
	cd dps/peak_search; make -f Makefile.linux
	@ echo "Making GUI routines"  
	cd gui_dialogs/dpa_dialog; make -f Makefile.linux
	cd gui_dialogs/dpg_dialog; make -f Makefile.linux
	cd gui_dialogs/mc_dialog; make -f Makefile.linux
	cd gui_dialogs/mm_dialog; make -f Makefile.linux
	cd gui_dialogs/ref_dialog; make -f Makefile.linux
	cd gui_dialogs/ucell_dialog; make -f Makefile.linux
	cd gui_dialogs/processing_gui; make -f Makefile.linux
	cd gui_dialogs/lft; make -f Makefile.linux
	@ echo "Making addf"  
	cd addf; make -f Makefile.linux
	@ echo "Making addi"  
	cd addi; make -f Makefile.linux
	@ echo "Making adxv2dps_coord"  
	cd adxv2dps_coord; make -f Makefile.linux
	@ echo "Making adxv2mos_coord"  
	cd adxv2mos_coord; make -f Makefile.linux
	@ echo "Making bravais_to_mosflm"  
	cd bravais_to_mosflm; make -f Makefile.linux
	cd cell_constrain; make -f Makefile.linux
	@ echo "Making check_filenames"  
	cd check_filenames; make -f Makefile.linux
	@ echo "Making condense_bravais"  
	cd condense_bravais; make -f Makefile.linux
	@ echo "Making divf"  
	cd divf; make -f Makefile.linux
	@ echo "Making end_imno"  
	cd end_imno; make -f Makefile.linux
	@ echo "Making extract_refine_items"  
	cd extract_refine_items; make -f Makefile.linux
	@ echo "Making gdb_from_sav"  
	cd gdb_from_sav; make -f Makefile.linux
	@ echo "Making get_gdb"  
	cd get_gdb; make -f Makefile.linux
	@ echo "Making make_3digit"  
	cd make_3digit; make -f Makefile.linux
	@ echo "Making mh_st"  
	cd mh_st; make -f Makefile.linux
	@ echo "Making mos2adxv_mm"  
	cd mos2adxv_mm; make -f Makefile.linux
	@ echo "Making mos2dps_coord"  
	cd mos2dps_coord; make -f Makefile.linux
	@ echo "Making mosflm_partition"  
	cd mosflm_partition; make -f Makefile.linux
#	@ echo "Making mtz2various_cn"  
#	cd mtz2various_cn; make -f Makefile.linux
#	@ echo "Making postchk"  
#	cd postchk; make -f Makefile.linux
	@ echo "Making put_gdb"  
	cd put_gdb; make -f Makefile.linux
	@ echo "Making subf"  
	cd subf; make -f Makefile.linux
	@ echo "Making subi"  
	cd subi; make -f Makefile.linux
	@ echo "Making system_from_info"  
	cd system_from_info; make -f Makefile.linux
#	@ echo "Making mosflm"  
#	cd mosflm; make -f Makefile.linux
	@ echo "Done"  

clean:
	cd gui_lib; make -f Makefile.sgi clean
	cd purdue; make -f Makefile.sgi clean
	cd dps/util; make -f Makefile.sgi clean
	cd dps/index; make -f Makefile.sgi clean
	cd dps/bravais; make -f Makefile.sgi clean
	cd dps/peak_search; make -f Makefile.sgi clean
	cd gui_dialogs/dpa_dialog; make -f Makefile.sgi clean
	cd gui_dialogs/dpg_dialog; make -f Makefile.sgi clean
	cd gui_dialogs/mc_dialog; make -f Makefile.sgi clean
	cd gui_dialogs/mm_dialog; make -f Makefile.sgi clean
	cd gui_dialogs/ref_dialog; make -f Makefile.sgi clean
	cd gui_dialogs/ucell_dialog; make -f Makefile.sgi clean
	cd gui_dialogs/processing_gui; make -f Makefile.sgi clean
	cd gui_dialogs/lft; make -f Makefile.sgi clean
	cd addf; make -f Makefile.sgi clean
	cd addi; make -f Makefile.sgi clean
	cd adxv2dps_coord; make -f Makefile.sgi clean
	cd adxv2mos_coord; make -f Makefile.sgi clean
	cd bravais_to_mosflm; make -f Makefile.sgi clean
	cd cell_constrain; make -f Makefile.sgi clean
	cd check_filenames; make -f Makefile.sgi clean
	cd condense_bravais; make -f Makefile.sgi clean
	cd divf; make -f Makefile.sgi clean
	cd end_imno; make -f Makefile.sgi clean
	cd extract_refine_items; make -f Makefile.sgi clean
	cd gdb_from_sav; make -f Makefile.sgi clean
	cd get_gdb; make -f Makefile.sgi clean
	cd make_3digit; make -f Makefile.sgi clean
	cd mh_st; make -f Makefile.sgi clean
	cd mos2adxv_mm; make -f Makefile.sgi clean
	cd mos2dps_coord; make -f Makefile.sgi clean
	cd mosflm_partition; make -f Makefile.sgi clean
	cd mtz2various_cn; make -f Makefile.sgi clean
	cd postchk; make -f Makefile.sgi clean
	cd put_gdb; make -f Makefile.sgi clean
	cd subf; make -f Makefile.sgi clean
	cd subi; make -f Makefile.sgi clean
	cd system_from_info; make -f Makefile.sgi clean
	cd mosflm; make -f Makefile.sgi clean
