##### User configurable options #####
# This is an example Makefile.in (or Makefile configured with mpireconfig)

LARCH       = @ARCH@
COMM        = @COMM@
INSTALL_DIR = @MPIR_HOME@
CC          = @CC@
F77         = @F77@
CLINKER     = @CLINKER@
FLINKER     = @FLINKER@
OPTFLAGS    = @OPTFLAGS@
#
LIB_PATH    = -L$(INSTALL_DIR)/lib/$(LARCH)/$(COMM)
FLIB_PATH   = @FLIB_PATH_LEADER@$(INSTALL_DIR)/lib/$(LARCH)/$(COMM)
LIB_LIST    = @LIB_LIST@
MPE_LIBS    = @MPE_LIBS@
#
INCLUDE_DIR = @INCLUDE_PATH@ -I$(INSTALL_DIR)/include

### End User configurable options ###

CFLAGS  = @CFLAGS@ $(OPTFLAGS) $(INCLUDE_DIR) -DMPI_$(LARCH)
FFLAGS = @FFLAGS@ $(INCLUDE_DIR) $(OPTFLAGS)
LIBS = $(LIB_PATH) -lmpe $(LIB_LIST)
FLIBS = $(FLIB_PATH) $(LIB_LIST)
EXECS = pttest fpilog

default: pttest

all: $(EXECS)

pttest: pttest.o 
	$(CLINKER) $(OPTFLAGS) -o pttest pttest.o \
	$(LIB_PATH) -lmpe $(LIB_LIST) -lm

fpilog: fpi.o 
	$(FLINKER) $(OPTFLAGS) -o fpilog fpi.o $(FLIB_PATH) \
	-lfmpi -llmpi -lpmpi -lm $(MPE_LIBS) $(LIB_LIST)
clean:
	/bin/rm -f *.o *~ PI* $(EXECS)

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

