#  (C) 1993 by Argonne National Laboratory and Mississipi State University.
#      All rights reserved.  See COPYRIGHT in top-level directory.
#

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

ARCH        = @ARCH@
COMM        = @COMM@
BOPT        = @BOPT@
MPIR_HOME   = @MPIR_HOME@
CC          = @CC@
CLINKER     = @CLINKER@
F77         = @F77@
AR          = @AR@
RANLIB      = @RANLIB@
INCLUDE_DIR = @INCLUDE_PATH@ -I$(MPIR_HOME)/include @X_INC@
DEVICE      = @DEVICE@
OPTFLAGS    = @OPTFLAGS@
MPE_GRAPH   = @MPE_GRAPHICS@
LIB_PATH    = @LIB_PATH@ @X_LIB@
# On the meiko, you need to add -lsocket to LIB_LIST
LIB_LIST    = @LIB_LIST@

MPEGRAPHICS_SOURCE = @MPEGRAPHICS_SOURCE@
MPEGRAPHICS_OBJS   = @MPEGRAPHICS_OBJS@
MPEGRAPHICS_FSOURCE = @MPEGRAPHICS_FSOURCE@
MPEGRAPHICS_FOBJS   = @MPEGRAPHICS_FOBJS@
### End User configurable options ###

SHELL = /bin/sh

CFLAGS = @CFLAGS@ $(OPTFLAGS) $(INCLUDE_DIR) $(MPIPROFILE) -DMPI_$(ARCH) \
	 $(MPE_GRAPH)

MPE_CSOURCES = timers.c  $(MPEGRAPHICS_SOURCE) mpe_log.c decomp.c \
	       mpe_seq.c mpehname.c
MPE_TSOURCES = $(MPEGRAPHICS_SOURCE) decomp.c mpe_seq.c dbxerr.c
MPE_COBJECTS = timers.o  $(MPEGRAPHICS_OBJS) mpe_log.o decomp.o mpe_seq.o \
		dbxerr.o mpehname.o
MPE_WSOURCES = $(MPEGRAPHICS_FSOURCE) mpe_logf.c decompf.c mpe_seqf.c
MPE_WOBJECTS = timersf.o $(MPEGRAPHICS_FOBJS) mpe_logf.o decompf.o mpe_seqf.o

MPE_SOURCES = $(MPE_CSOURCES) $(MPE_WSOURCES)
MPE_OBJECTS = $(MPE_COBJECTS) $(MPE_WOBJECTS)

#
# It is tempting here to use ... libmpe.a($(MPE_OBJECTS)) as the dependency,
# but this would require that all makes properly handle library dependencies.
# Since makes that DO are the exception rather than the rule, we don't
# use this form
$(MPIR_HOME)/lib/$(ARCH)/$(COMM)/libmpe_nompi.a: $(MPEGRAPHICS_OBJS) mpehname.o
	$(AR) $@ $?
	$(RANLIB) $@
	-/bin/rm -f $?

.c.o:
	$(CC) $(CFLAGS) -DMPE_NOMPI -c $*.c

.c.a:
	$(CC) $(CFLAGS) -DMPE_NOMPI -c $*.c
