#
#  $Id: Makefile.in,v 1.2 1996/06/13 14:52:49 gropp Exp $
#
#  (C) 1993,1995 by Argonne National Laboratory and Mississipi State University.
#      All rights reserved.  See COPYRIGHT in top-level directory.
#
# Eventually, there will be two sets of routines
#
#
##### User configurable options #####

ARCH        = @ARCH@
COMM        = @COMM@
DEVICE      = @DEVICE@
MPIR_HOME   = @MPIR_HOME@
INCLUDE_DIR = @INCLUDE_PATH@ -Impid/@DEVICE@ -Iinclude
CC          = @CC@
AR          = @AR@
RANLIB      = @RANLIB@
OPTFLAGS    = @OPTFLAGS@
SHELL       = /bin/sh
ASMFILES_O  = @ASMFILES_O@
### End User configurable options ###

ALL: default

LIBNAME  = ../../lib/$(ARCH)/$(COMM)/lib@MPILIBNAME@.a
CFLAGS   = @CFLAGS@ $(OPTFLAGS) -I../.. -I../../include -I./ \
		-DMPI_$(ARCH) -DMPID_DEVICE_CODE @GETNAME_DEFS@ @DEVCFLAGS@ \
	        @DEV_DEFS@
# See mpid/ch_adi2/Makefile.in for a full list
SOURCE   = adi2recv.c adi2send.c adi2init.c \
	   chbeager.c chbrndv.c chdebug.c chrecv.c chshort.c \
	   @DEVCFILES@
SOURCEC  = $(SOURCE)
SOURCEF  =
MPI_OBJECTS = adi2recv.o adi2send.o adi2init.o \
	   chbeager.o chbrndv.o chdebug.o chrecv.o chshort.o \
	      $(ASMFILES_O) @DEVOFILES@

default: $(LIBNAME)
local: libmpid.a

# default_all is the same as default, but without the RANLIB.  This
# can speed up the build (ranlibs can take a LONG time).  profile_all 
# is the same, but for the profile library
default_all: $(MPI_OBJECTS)
	$(AR) $(LIBNAME) $?
profile_all: 

$(MPI_OBJECTS): dev.h req.h mpid.h

clean:
	/bin/rm -f *~ $(MPI_OBJECTS) 

.c.o:
	$(CC) $(CFLAGS) $(BASEOPT) -c $*.c $(MPI_PROFILE)

.o.s:
	$(CC) $(CFLAGS) $(BASEOPT) -c -S $*.c $(MPI_PROFILE)

../../lib/$(ARCH)/$(COMM)/lib@MPILIBNAME@.a: $(MPI_OBJECTS) 
	$(AR) $@ $?
	$(RANLIB) $@

libmpid.a: $(MPI_OBJECTS) 
	$(AR) $@ $?
	$(RANLIB) $@

