# Generated automatically from Makefile.in by configure.
ALL: default
##### User configurable options #####

MPIR_HOME   = /usr
CC          = /usr/lib/LINUX/ch_p4/mpicc
CLINKER     = /usr/lib/LINUX/ch_p4/mpicc
CCC         = /usr/lib/LINUX/ch_p4/mpiCC
CCLINKER    = $(CCC)
F77         = /usr/lib/LINUX/ch_p4/mpif77
FLINKER     = /usr/lib/LINUX/ch_p4/mpif77
OPTFLAGS    = -O
MPIFDEP     = 

### End User configurable options ###

SHELL = /bin/sh

PROFLIB =
CFLAGS  =  -DHAVE_PROTOTYPES  -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DUSE_STDARG $(OPTFLAGS) 
CCFLAGS = $(CFLAGS)
FFLAGS = $(OPTFLAGS)
# Use LIBS to add any special libraries for C programs
LIBS = 
# Use FLIBS to add any special libraries for Fortran programs
FLIBS = 
EXECS = cart cart2 graphtest cartmap cartorder

default: $(EXECS)

#
# Note that runtests builds the executables as required
testing: 
	-./runtests $(TESTARGS)

linktest: default clean

all: testing

fortran_tests: cartf twod cart1f cart2f

cart: cart.o test.o
	$(CLINKER) $(OPTFLAGS) -o cart cart.o test.o $(LIBS)

cartmap: cartmap.o
	$(CLINKER) $(OPTFLAGS) -o cartmap cartmap.o $(LIBS)

cartorder: cartorder.o test.o
	$(CLINKER) $(OPTFLAGS) -o cartorder cartorder.o test.o $(LIBS)

cart2: cart2.o test.o
	$(CLINKER) $(OPTFLAGS) -o cart2 cart2.o test.o $(LIBS)

graphtest: graphtest.o
	$(CLINKER) $(OPTFLAGS) -o graphtest graphtest.o $(LIBS)

cartf: $(MPIFDEP) cartf.o
	$(FLINKER) $(OPTFLAGS) -o cartf cartf.o $(FLIBS)

cart1f: $(MPIFDEP) cart1f.o
	$(FLINKER) $(OPTFLAGS) -o cart1f cart1f.o $(FLIBS)

cart2f: $(MPIFDEP) cart2f.o
	$(FLINKER) $(OPTFLAGS) -o cart2f cart2f.o $(FLIBS)

twod: $(MPIFDEP) twod.o
	$(FLINKER) $(OPTFLAGS) -o twod twod.o $(FLIBS)

#
# Some systems have no test for a symbolic link and return false for
# a link that exists
mpif.h: $(MPIR_HOME)/include/mpif.h
	if test \! -f mpif.h ; then \
	    /bin/rm -f mpif.h ; \
	    ln -s $(MPIR_HOME)/include/mpif.h . ; \
	fi
clean:
	@-/bin/rm -f *.o *~ core PI* $(EXECS) cartf twod cart1f cart2f \
	*.out topol.diff *.trace

.c.o:
	$(CC) $(CFLAGS) -c $*.c
.f.o:
	$(F77) $(FFLAGS) -c $*.f
