#
# Laboratory for Scientific Computing
# http://www.lam-mpi.org/tutorials/
# University of Notre Dame
#
# MPI Tutorial
# Sample Makefile
#
# "mpicc" adds the directories for the include and lib files.  Hence,
# -I and -L for MPI stuff is not necessary
#

CC        = mpicc

#
# Modify TOPDIR if you use your own include files and library files
#

TOPDIR    = .
LIBDIR    = $(TOPDIR)/libs
INCDIR    = $(TOPDIR)/include

LIBS      = 				# add any -l's that you need here
					# don't need any for the sample program

CFLAGS    = -I$(INCDIR)
LDFLAGS   = -L$(LIBDIR) $(LIBS)

PROGRAM   = hello			# name of the binary
SRCS      = MPI_C_SAMPLE.c		# source file
OBJS      = $(SRCS:.c=.o)		# object file

#
# Rules
#

.SUFFIXES: .c .o

.c.o: 
	$(CC) -c $(CFLAGS) $<

#
# Targets
#

default: all

all: $(PROGRAM) 

$(PROGRAM): $(OBJS)
	$(CC) $(OBJS) -o $(PROGRAM) $(LDFLAGS)

clean:
	/bin/rm -f $(OBJS) $(PROGRAM)


