# Makefile for MPI-BMMC functions.

# $Id: Makefile,v 1.3 1997/05/07 16:00:32 thc Exp $
# $Log: Makefile,v $
# Revision 1.3  1997/05/07 16:00:32  thc
# Removed info filled in by makedepend for release.
#
# Revision 1.2  1997/05/06 19:24:24  thc
# Renamed test to test_bmmc and test_comm to test_bmmc_comm.
#
# Revision 1.1  1997/05/05 14:20:54  thc
# Initial revision
#

# Fill in MPI_INC as the directory containing mpi.h,
# and fill in MPI_LIB as the directory containing libmpi.a
# You probably want these directories to be relative to MPI_HOME,
# which you should also fill in.

MPI_HOME = /u/thc/ViC/MPI-BMMC/mpich
MPI_INC = $(MPI_HOME)/include
MPI_LIB = $(MPI_HOME)/lib/alpha/ch_p4

# Fill in CC as your favorite C compiler,
# and change AR and RANLIB if necessary.
CC = gcc -Wall -Wmissing-prototypes
AR = ar
RANLIB = ranlib

SRCS = bit_matrix_fns.c bmmc_mpi.c
OBJS = $(SRCS:.c=.o)

CFLAGS = -I$(MPI_INC) $(DEBUG) $(VERBOSE)
LFLAGS = -L$(MPI_LIB) -lmpi

# DEBUG = -g
# DEBUG = -g -DDEBUG
DEBUG = -O2

# VERBOSE =
VERBOSE = -DVERBOSE

.c.o:
	$(CC) -c $(CFLAGS) $<

libbmmc_mpi.a: $(OBJS)
	$(AR) cr $@ $(OBJS); $(RANLIB) $@

test_bmmc: libbmmc_mpi.a test_bmmc_mpi.o
	$(CC) -o $@ test_bmmc_mpi.o -L. -lbmmc_mpi $(LFLAGS)

test_bmmc_comm: libbmmc_mpi.a test_bmmc_mpi_comm.o
	$(CC) -o $@ test_bmmc_mpi_comm.o -L. -lbmmc_mpi $(LFLAGS)

clean:
	rm -f $(OBJS) test_bmmc_mpi.o test_bmmc_mpi_comm.o libbmmc_mpi.a

depend:
	makedepend -- $(CFLAGS) -- $(SRCS)

# DO NOT DELETE THIS LINE -- make depend depends on it.
