# Generated automatically from Makefile.in by configure.
##### User configurable options #####
# This is an example Makefile.in (or Makefile configured with mpireconfig)
# for the programs cpi, pi3, and cpilog.  

ARCH        = LINUX
COMM        = ch_p4
INSTALL_DIR = /opt/mpich-1.1.0
CC          = cc
F77         = echo no Fortran compiler
CLINKER     = cc
FLINKER     = echo no Fortran compiler
OPTFLAGS    = 
#
LIB_PATH    = -L/opt/mpich-1.1.0/lib/LINUX/ch_p4 
FLIB_PATH   = -L/opt/mpich-1.1.0/lib/LINUX/ch_p4 
LIB_LIST    = -lmpi  
#
INCLUDE_DIR =  -I$(INSTALL_DIR)/include

### End User configurable options ###

CFLAGS  =  -DHAVE_CONFIG_H -I../../mpid/ch2 -I../../lib/LINUX/ch_p4 $(OPTFLAGS) $(INCLUDE_DIR) -DMPI_$(ARCH)
FFLAGS =  $(INCLUDE_DIR) $(OPTFLAGS)
LIBS = $(LIB_PATH) $(LIB_LIST)
FLIBS = $(FLIB_PATH) $(LIB_LIST)
EXECS = pi3 cpi cpilog cpilog2

default: cpi pi3

all: $(EXECS)

cpi: cpi.o $(INSTALL_DIR)/include/mpi.h
	$(CLINKER) $(OPTFLAGS) -o cpi cpi.o \
	$(LIB_PATH) $(LIB_LIST) -lm

cpilog: cpilog.o $(INSTALL_DIR)/include/mpi.h $(INSTALL_DIR)/include/mpe.h
	$(CLINKER) $(OPTFLAGS) -o cpilog cpilog.o \
	$(LIB_PATH) -lmpe $(LIB_LIST) -lm

pi3: pi3.o $(INSTALL_DIR)/include/mpif.h
	$(FLINKER) $(OPTFLAGS) -o pi3 pi3.o $(FLIBS)

alternate:
	@echo "Use mpif77 and mpicc to build the programs"
	@echo "Note the use of an explicit path for the mpif77 and mpicc"
	@echo "commands; this allows multiple versions/devices to"
	@echo "coexist."
	$(INSTALL_DIR)/lib/$(ARCH)/$(COMM)/mpif77 -o pi3 pi3.f
	$(INSTALL_DIR)/lib/$(ARCH)/$(COMM)/mpicc -o cpi cpi.c -lm 
	$(INSTALL_DIR)/lib/$(ARCH)/$(COMM)/mpicc -o cpilog2 -mpitrace cpi.c -lm


clean:
	/bin/rm -f *.o *~ PI* $(EXECS)

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

