# Makefile to build spheray and accompanying programs
#
# for HP 9000
#FFLAGS = -O -Dhp
#FC     = fort77

# for Sun
#FFLAGS = -O -native -misalign -Bstatic
#FC     = f77

# for AIX
FC	= f77
FFLAGS = -O

LIB    = spheray.lib.o
INCL   = spheray.ins.f

ALL    = SPHERAY CRAY2MACRO

TARGET1 = $(HOME)/bin/$(ARCH)/spheray
TARGET2 = $(HOME)/bin/$(ARCH)/cray2macro

default : $(ALL)

SPHERAY : $(TARGET1)
$(TARGET1) : spheray.o spheray1.o spheray2.o $(LIB)
	$(FC) $(FFLAGS) -o $@ spheray.o spheray1.o spheray2.o $(LIB)
spheray1.o : spheray1.F $(INCL)
	$(FC) $(FFLAGS) -c spheray1.F
spheray.o : spheray.f $(INCL)


CRAY2MACRO : $(TARGET2)
$(TARGET2) : cray2macro.o form_cray.o
	$(FC) $(FFLAGS) -o $@ cray2macro.o form_cray.o
cray2macro.o : cray2macro.f
form_cray.o : form_cray.f

spheray.lib.o : spheray.lib.f
	$(FC) $(FFLAGS) -c spheray.lib.f

clean : 
	/bin/rm *.o


not_available : @echo not available
