######################################################################
#                           LANZ Software Package                    #
# Filename: Makefile                                                 #
# Contents: Makefile that makes the machine specific makefile        #
# Author: Mark Jones                                                 #
######################################################################

#Directory in which the components for the machine specific makefiles reside
MDIR=Makedir

#Error, no machine specified
other:	
	echo 'Specify a machine type to make for'

#Make an executable (including test program) for the Convex 220
convex:
	cd MAX;make -f makefile.convex all
	cat $(MDIR)/convex.head > Makefile.convex
	cat $(MDIR)/all.body1 >> Makefile.convex
	cat $(MDIR)/convex.body >> Makefile.convex
	cat $(MDIR)/all.body3 >> Makefile.convex
	make -f Makefile.convex all

#Make the LANZ library for the Convex 220
convex_lib:
	cd MAX;make -f makefile.convex all
	cat $(MDIR)/convex.head > Makefile.convex
	cat $(MDIR)/all.body1 >> Makefile.convex
	cat $(MDIR)/convex.body >> Makefile.convex
	cat $(MDIR)/all.body3 >> Makefile.convex
	make -f Makefile.convex all_lib

#Make an executable (including test program) for the CRAY Y-MP
cray:
	cd MAX;make -f makefile.cray all
	cat $(MDIR)/cray.head > Makefile.cray
	cat $(MDIR)/all.body1 >> Makefile.cray
	cat $(MDIR)/cray.body >> Makefile.cray
	cat $(MDIR)/all.body3 >> Makefile.cray
	make -f Makefile.cray all

#Make the LANZ library for the CRAY Y-MP
cray_lib:
	cd MAX;make -f makefile.cray all
	cat $(MDIR)/cray.head > Makefile.cray
	cat $(MDIR)/all.body1 >> Makefile.cray
	cat $(MDIR)/cray.body >> Makefile.cray
	cat $(MDIR)/all.body3 >> Makefile.cray
	make -f Makefile.cray all_lib

#Make an executable (including test program) for the SUN-4
sun4:
	cd MAX;make -f makefile.sun4 all
	cat $(MDIR)/sun4.head > Makefile.sun4
	cat $(MDIR)/all.body1 >> Makefile.sun4
	cat $(MDIR)/sun4.body >> Makefile.sun4
	cat $(MDIR)/all.body3 >> Makefile.sun4
	make -f Makefile.sun4 all

#Make the LANZ library for the SUN-4
sun4_lib:
	cd MAX;make -f makefile.sun4 all
	cat $(MDIR)/sun4.head > Makefile.sun4
	cat $(MDIR)/all.body1 >> Makefile.sun4
	cat $(MDIR)/sun4.body >> Makefile.sun4
	cat $(MDIR)/all.body3 >> Makefile.sun4
	make -f Makefile.sun4 all_lib

#Make an executable (including test program) for the SUN-3
sun3:
	cd MAX;make -f makefile.sun3 all
	cat $(MDIR)/sun3.head > Makefile.sun3
	cat $(MDIR)/all.body1 >> Makefile.sun3
	cat $(MDIR)/sun3.body >> Makefile.sun3
	cat $(MDIR)/all.body3 >> Makefile.sun3
	make -f Makefile.sun3 all

#Make the LANZ library for the SUN-3
sun3_lib:
	cd MAX;make -f makefile.sun3 all
	cat $(MDIR)/sun3.head > Makefile.sun3
	cat $(MDIR)/all.body1 >> Makefile.sun3
	cat $(MDIR)/sun3.body >> Makefile.sun3
	cat $(MDIR)/all.body3 >> Makefile.sun3
	make -f Makefile.sun3 all_lib

#Make an Force executable (including test program) for the Encore Multimax
encore:
	cd MAX;make -f makefile.encore all
	cat $(MDIR)/encore.head > Makefile.encore
	cat $(MDIR)/all.body1 >> Makefile.encore
	cat $(MDIR)/encore.body >> Makefile.encore
	cat $(MDIR)/all.body3 >> Makefile.encore
	make -f Makefile.encore -N 10 all

#Make the Force LANZ library for the Encore Multimax
encore_lib:
	cd MAX;make -f makefile.encore all
	cat $(MDIR)/encore.head > Makefile.encore
	cat $(MDIR)/all.body1 >> Makefile.encore
	cat $(MDIR)/encore.body >> Makefile.encore
	cat $(MDIR)/all.body3 >> Makefile.encore
	make -f Makefile.encore -N 10 all_lib

#Make an Force executable (including test program) for the CRAY Y-MP
pymp:
	cd MAX;make -f makefile.cray all
	cat $(MDIR)/pymp.head > Makefile.pymp
	cat $(MDIR)/all.body1 >> Makefile.pymp
	cat $(MDIR)/pymp.body >> Makefile.pymp
	cat $(MDIR)/all.body3 >> Makefile.pymp
	make -f Makefile.pymp all

#Make the Force LANZ library for CRAY Y-MP
pymp_lib:
	cd MAX;make -f makefile.cray all
	cat $(MDIR)/pymp.head > Makefile.pymp
	cat $(MDIR)/all.body1 >> Makefile.pymp
	cat $(MDIR)/pymp.body >> Makefile.pymp
	cat $(MDIR)/all.body3 >> Makefile.pymp
	make -f Makefile.pymp all_lib

#Make an executable version for the CSM Testbed on the Convex 220
convtb:
	cat $(MDIR)/convtb.head > Makefile.convtb
	cat $(MDIR)/all.body1 >> Makefile.convtb
	cat $(MDIR)/convtb.body >> Makefile.convtb
	cat $(MDIR)/all.body3 >> Makefile.convtb
	make -f Makefile.convtb all

#Make an executable version for the CSM Testbed on the CRAY-2
cray2tb:
	cat $(MDIR)/cray2tb.head > Makefile.cray2tb
	cat $(MDIR)/all.body1 >> Makefile.cray2tb
	cat $(MDIR)/cray2tb.body >> Makefile.cray2tb
	cat $(MDIR)/all.body3 >> Makefile.cray2tb
	make -f Makefile.cray2tb all

######################################################################
#end of Makefile
######################################################################
