
CIVL = civl

# verification of sequential library
seq: mm_lib.h mm_lib.c mm_driver.cvl
	$(CIVL) verify mm_driver.cvl mm_lib.c

# verification of MPI library
mpi: mm_lib.h mm_mpi_lib.c mm_mpi_driver.cvl
	$(CIVL) verify -input_mpi_nprocs=3 mm_mpi_driver.cvl mm_mpi_lib.c

# comparison of sequential and MPI libraries
compare: mm_lib.h mm_lib.c mm_driver.cvl mm_mpi_lib.c mm_mpi_driver.cvl
	$(CIVL) compare  -collectHeaps=false -inputL=3 -inputM=3 -spec mm_driver.cvl mm_lib.c -impl -input_mpi_nprocs=3 mm_mpi_driver.cvl mm_mpi_lib.c

# test of sequential library
seq_test:  mm_lib.h mm_lib.c mm_driver.c
	cc -o mm_test.exe mm_driver.c mm_lib.c
	./mm_test.exe

# test of MPI library
mpi_test:  mm_lib.h mm_mpi_lib.c mm_mpi_driver.c
	mpicc -o mm_mpi_test.exe mm_mpi_driver.c mm_mpi_lib.c
	mpiexec -n 3 ./mm_mpi_test.exe

clean:
	rm -rf *~ CIVLREP *.exe
