
##### User configurable options #####

MPI_CC      = @MPI_CC@
MPI_CLINKER = $(MPI_CC)
#
MPI_INC     = @MPI_INC@
MPI_LIBS    = @MPI_LIBS@
CFLAGS      = @CFLAGS@
MPE_INCDIR  = @includebuild_dir@
MPE_LIBDIR  = @libbuild_dir@
PROF_LIBS   = -L$(MPE_LIBDIR) @PROF_LIBS@ @X_LIB@ $(MPI_LIBS) -lm
#
INCLUDE_DIR = -I$(MPE_INCDIR) $(MPI_INC)
LDFLAGS     = @LDFLAGS@

### End User configurable options ###

RM          = rm

@VPATH@

srcdir      = @srcdir@

CC_FLAGS    = $(CFLAGS) $(INCLUDE_DIR) $(MPE_COPTS)
CC_LDFLAGS  = $(LDFLAGS) $(CFLAGS) $(MPE_LDOPTS)
EXECS       = gmm@EXEEXT@ mm@EXEEXT@ vb@EXEEXT@

.SUFFIXES: .c .@OBJEXT@ @EXEEXT@

.c.@OBJEXT@:
	$(MPI_CC) $(CC_FLAGS) -c $<

.@OBJEXT@@EXEEXT@:
	$(MPI_CLINKER) $(CC_LDFLAGS) -o $@ $< $(PROF_LIBS)

default: $(EXECS)

gmm.@OBJEXT@:	gmm.c
	$(MPI_CC) $(CC_FLAGS) -DUSE_GRAPHICS -c $?

mm.@OBJEXT@:	gmm.c
	$(MPI_CC) $(CC_FLAGS) -c -o mm.@OBJEXT@ $?

vb.@OBJEXT@:	vb.c
	$(MPI_CC) $(CC_FLAGS) -c $?

clean:
	@-$(RM) -f *.@OBJEXT@ *~ PI* $(EXECS) gmmlog

distclean: clean
	@-$(RM) -f Makefile
