CHARMC=../../../../bin/charmc $(OPTS)

#for SUN/Solaris: elegance, asuncion : ucomment next line
F90LIB =  -lfsu -lsunmath

#for CSE : ucomment next line
#F90LIB =  -lf90

#for turing.cs : ucomment next line
#F90LIB = -lfio -lf77math

#for origin2000 : ucomment next line
#F90LIB = -L/usr/lib64 -lfortran

all: jacobi

jacobi:  receiver.o jacobi.o chunk.o jacobi90.o
	$(CHARMC) -o jacobi jacobi.o receiver.o chunk.o jacobi90.o $(F90LIB) -language charm++

main.o: main.C main.h main.decl.h
	$(CHARMC) -c main.C

jacobi.o: jacobi.C jacobi.h jacobi.decl.h
	$(CHARMC) -c jacobi.C

receiver.o: receiver.C receiver.h receiver.decl.h
	$(CHARMC) -c receiver.C

jacobi.decl.h: jacobi.ci
	$(CHARMC) -c jacobi.ci

main.decl.h: main.ci
	$(CHARMC) -c main.ci

receiver.decl.h: receiver.ci
	$(CHARMC) -c receiver.ci

jacobi90.o : jacobi90.f90
	f90 -g -c jacobi90.f90

chunk.o : chunk.f90
	f90 -g -c chunk.f90

clean:
	/bin/rm -f conv-host *.o jacobi *.decl.h *.def.h core *.mod *.MOD charmrun
