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

SHELL       = /bin/sh
ARCH        = LINUX
COMM        = ch_p4
MPIR_HOME   = /usr
CC          = /usr/lib/LINUX/ch_p4/mpicc
CLINKER     = $(CC)
F77         = /usr/lib/LINUX/ch_p4/mpif77
FLINKER     = $(F77)
CCC         = /usr/lib/LINUX/ch_p4/mpiCC
CCLINKER    = $(CCC)
AR          = ar crl
RANLIB      = ranlib
PMPILIB     = -lpmpich
OPTFLAGS    = -O
MPE_LIBS    = -L/usr/X11R6/lib -lmpe -lX11 -lm
MPE_DIR     = /usr/mpe
MPE_GRAPH   = -DMPE_GRAPHICS
#

### End User configurable options ###

CFLAGS	  = $(OPTFLAGS) 
CFLAGSMPE = $(CFLAGS) -I$(MPE_DIR) $(MPE_GRAPH)
CCFLAGS	  = $(CFLAGS)
#FFLAGS	  = '-qdpc=e' 
FFLAGS	  = $(OPTFLAGS)
EXECS	  = cpi systest fpi cpilog srtest hello++ iotest

default: $(EXECS)

all: default

fpi: fpi.o $(MPIR_HOME)/include/mpif.h
	$(FLINKER) $(OPTFLAGS) -o fpi fpi.o

cpi: cpi.o
	$(CLINKER) $(OPTFLAGS) -o cpi cpi.o -lm

cpilog: cpilog.o
	$(CLINKER) $(OPTFLAGS) -o cpilog cpilog.o -lmpe $(PMPILIB) -lm

srtest: srtest.o
	$(CLINKER) $(OPTFLAGS) -o srtest srtest.o -lm

systest: systest.o
	$(CLINKER) $(OPTFLAGS) -o systest systest.o -lm

iotest: iotest.o
	$(CLINKER) $(OPTFLAGS) -o iotest iotest.o -lm

hello++: hello++.o
	$(CCLINKER) hello++.o -o hello++

unsafe: unsafe.o
	$(CLINKER) $(OPTFLAGS) -o unsafe unsafe.o 
clean:
	/bin/rm -f *.o *~ PI* $(EXECS) rdb.* startup.*

cpilog.o: cpilog.c
	@if test -z "$(MPE_DIR)" ; then \
	    echo "Can only build cpilog if MPE libraries built" ; \
	    echo "Use -mpe to configure to have the MPE libraries built" ; \
	    exit 1 ; \
	fi
	$(CC) $(CFLAGSMPE) -c cpilog.c
.c.o:
	$(CC) $(CFLAGS) -c $*.c
.f.o:
	$(F77) $(FFLAGS) -c $*.f
.cc.o:
	$(CCC) -c $*.cc
