# File         : Makefile
# Author       : Sung-Hoon Ko, Xinying Li
# Created      : Thu Apr 1998
# Revision     : ver 1.1
# Updated      : $Date: 1998/08/31 16:19:31 $
# Copyright: Northeast Parallel Architectures Center at Syracuse University 1998

SHELL       = /bin/sh


srcdir = @srcdir@
top_srcdir = @top_srcdir@

VPATH = .:${srcdir}


JDK = @JAVA@

MPI_INC = @MPI_INC@
MPI_LIB = @MPI_LIB@

CCLIBKEY = @CCLIBKEY@

INCLUDES = -I$(JDK)/include -I$(JDK)/include/@JOS@ -I$(MPI_INC)

CLASSES = @top_srcdir@/lib/classes
CLASSPATH = .:$(CLASSES):@CLASSPATH@

LIB = @top_srcdir@/lib

CDIR = @top_srcdir@/src/C

TITLE = mpi
PFX = $(TITLE)_
PKG = $(TITLE).
DIR = $(TITLE)/

RM = rm
CP = cp
MV = mv

JC = $(JDK)/bin/javac
JH = $(JDK)/bin/javah
JFLAG = -jni
CFLAGS = -c



JAVACLASS= \
    $(CLASSES)/$(DIR)MPI.class           \
    $(CLASSES)/$(DIR)CartParms.class     \
    $(CLASSES)/$(DIR)Cartcomm.class      \
    $(CLASSES)/$(DIR)Comm.class          \
    $(CLASSES)/$(DIR)Datatype.class      \
    $(CLASSES)/$(DIR)Errhandler.class    \
    $(CLASSES)/$(DIR)GraphParms.class    \
    $(CLASSES)/$(DIR)Graphcomm.class     \
    $(CLASSES)/$(DIR)Group.class         \
    $(CLASSES)/$(DIR)Intercomm.class     \
    $(CLASSES)/$(DIR)Intracomm.class     \
    $(CLASSES)/$(DIR)Op.class            \
    $(CLASSES)/$(DIR)Prequest.class      \
    $(CLASSES)/$(DIR)Request.class       \
    $(CLASSES)/$(DIR)ShiftParms.class    \
    $(CLASSES)/$(DIR)Status.class        \
    $(CLASSES)/$(DIR)User_function.class 



.SUFFIXES:
.SUFFIXES: .java .h .class


all: $(JAVACLASS) 


$(CLASSES)/$(DIR)MPI.class : MPI.java                         \
                             $(CLASSES)/$(DIR)Comm.class      \
                             $(CLASSES)/$(DIR)Intracomm.class \
                             $(CLASSES)/$(DIR)Group.class     \
                             $(CLASSES)/$(DIR)Op.class        \
                             $(CLASSES)/$(DIR)Datatype.class
	CLASSPATH=$(CLASSPATH) ; export CLASSPATH ; \
	$(JC) -d $(CLASSES)   MPI.java ; \
	$(JH) $(JFLAG) -d $(CDIR) $(PKG)MPI

$(CLASSES)/$(DIR)Comm.class : Comm.java                         \
                              $(CLASSES)/$(DIR)Datatype.class   \
                              $(CLASSES)/$(DIR)Status.class     \
                              $(CLASSES)/$(DIR)Prequest.class   \
                              $(CLASSES)/$(DIR)Op.class         \
                              $(CLASSES)/$(DIR)Group.class      \
                              $(CLASSES)/$(DIR)Errhandler.class \
                              Intercomm.java Intracomm.java     \
                              Cartcomm.java  Graphcomm.java     \
                              $(CLASSES)/$(DIR)ShiftParms.class \
                              $(CLASSES)/$(DIR)CartParms.class  \
                              $(CLASSES)/$(DIR)GraphParms.class
	CLASSPATH=$(CLASSPATH) ; export CLASSPATH ; \
	$(JC) -d $(CLASSES) Comm.java Intercomm.java Intracomm.java Cartcomm.java  Graphcomm.java ; \
	$(JH) $(JFLAG) -d $(CDIR) $(PKG)Comm      ; \
	$(JH) $(JFLAG) -d $(CDIR) $(PKG)Intercomm ; \
	$(JH) $(JFLAG) -d $(CDIR) $(PKG)Intracomm ; \
	$(JH) $(JFLAG) -d $(CDIR) $(PKG)Cartcomm  ; \
	$(JH) $(JFLAG) -d $(CDIR) $(PKG)Graphcomm 

$(CLASSES)/$(DIR)Datatype.class : Datatype.java
	CLASSPATH=$(CLASSPATH) ; export CLASSPATH ; \
	$(JC) -d $(CLASSES)   Datatype.java ; \
	$(JH) $(JFLAG) -d $(CDIR) $(PKG)Datatype

$(CLASSES)/$(DIR)Op.class : Op.java  \
	                    $(CLASSES)/$(DIR)User_function.class
	CLASSPATH=$(CLASSPATH) ; export CLASSPATH ; \
	$(JC) -d $(CLASSES)   Op.java ; \
	$(JH) $(JFLAG) -d $(CDIR) $(PKG)Op

$(CLASSES)/$(DIR)Status.class : Status.java
	CLASSPATH=$(CLASSPATH) ; export CLASSPATH ; \
	$(JC) -d $(CLASSES)   Status.java ; \
	$(JH) $(JFLAG) -d $(CDIR) $(PKG)Status

$(CLASSES)/$(DIR)Request.class : Request.java
	CLASSPATH=$(CLASSPATH) ; export CLASSPATH ; \
	$(JC) -d $(CLASSES)   Request.java ; \
	$(JH) $(JFLAG) -d $(CDIR) $(PKG)Request

$(CLASSES)/$(DIR)Prequest.class : Prequest.java \
                                  $(CLASSES)/$(DIR)Request.class
	CLASSPATH=$(CLASSPATH) ; export CLASSPATH ; \
	$(JC) -d $(CLASSES)   Prequest.java ; \
	$(JH) $(JFLAG) -d $(CDIR) $(PKG)Prequest

$(CLASSES)/$(DIR)Intracomm.class : Intracomm.java             \
                                   $(CLASSES)/$(DIR)Op.class  \
                                   $(CLASSES)/$(DIR)Comm.class 
	CLASSPATH=$(CLASSPATH) ; export CLASSPATH ; \
	$(JC) -d $(CLASSES)   Intracomm.java ; \
	$(JH) $(JFLAG) -d $(CDIR) $(PKG)Intracomm

$(CLASSES)/$(DIR)Intercomm.class : Intercomm.java \
                                   $(CLASSES)/$(DIR)Comm.class Intracomm.java
	CLASSPATH=$(CLASSPATH) ; export CLASSPATH ; \
	$(JC) -d $(CLASSES)   Intercomm.java ; \
	$(JH) $(JFLAG) -d $(CDIR) $(PKG)Intercomm

$(CLASSES)/$(DIR)Cartcomm.class : Cartcomm.java                     \
                                  $(CLASSES)/$(DIR)Intracomm.class  \
                                  $(CLASSES)/$(DIR)CartParms.class  \
                                  $(CLASSES)/$(DIR)ShiftParms.class
	CLASSPATH=$(CLASSPATH) ; export CLASSPATH ; \
	$(JC) -d $(CLASSES)   Cartcomm.java ; \
	$(JH) $(JFLAG) -d $(CDIR) $(PKG)Cartcomm

$(CLASSES)/$(DIR)Graphcomm.class : Graphcomm.java                    \
                                   $(CLASSES)/$(DIR)Intracomm.class  \
                                   $(CLASSES)/$(DIR)GraphParms.class
	CLASSPATH=$(CLASSPATH) ; export CLASSPATH ; \
	$(JC) -d $(CLASSES)   Graphcomm.java ; \
	$(JH) $(JFLAG) -d $(CDIR) $(PKG)Graphcomm

$(CLASSES)/$(DIR)CartParms.class : CartParms.java
	CLASSPATH=$(CLASSPATH) ; export CLASSPATH ; \
	$(JC) -d $(CLASSES)   CartParms.java ; \
	$(JH) $(JFLAG) -d $(CDIR) $(PKG)CartParms

$(CLASSES)/$(DIR)ShiftParms.class : ShiftParms.java
	CLASSPATH=$(CLASSPATH) ; export CLASSPATH ; \
	$(JC) -d $(CLASSES)   ShiftParms.java ; \
	$(JH) $(JFLAG) -d $(CDIR) $(PKG)ShiftParms

$(CLASSES)/$(DIR)GraphParms.class : GraphParms.java
	CLASSPATH=$(CLASSPATH) ; export CLASSPATH ; \
	$(JC) -d $(CLASSES)   GraphParms.java ; \
	$(JH) $(JFLAG) -d $(CDIR) $(PKG)GraphParms

$(CLASSES)/$(DIR)Group.class : Group.java
	CLASSPATH=$(CLASSPATH) ; export CLASSPATH ; \
	$(JC) -d $(CLASSES)   Group.java ; \
	$(JH) $(JFLAG) -d $(CDIR) $(PKG)Group

$(CLASSES)/$(DIR)Errhandler.class : Errhandler.java
	CLASSPATH=$(CLASSPATH) ; export CLASSPATH ; \
	$(JC) -d $(CLASSES)   Errhandler.java ; \
	$(JH) $(JFLAG) -d $(CDIR) $(PKG)Errhandler

$(CLASSES)/$(DIR)User_function.class : User_function.java
	CLASSPATH=$(CLASSPATH) ; export CLASSPATH ; \
	$(JC) -d $(CLASSES)   User_function.java ; \
	$(JH) $(JFLAG) -d $(CDIR) $(PKG)User_function


clean :
	$(RM) -f $(CLASSES)/$(DIR)*.class

