Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > be0974b2b8ed02af93714b256a53dd30 > files > 162

mpi4py-docs-1.2.2-6.fc15.noarch.rpm

.PHONY: default build test clean

default: build test clean

MASTERS = cpi-master-py.exe cpi-master-c.exe cpi-master-cxx.exe cpi-master-f90.exe
WORKERS = cpi-worker-py.exe cpi-worker-c.exe cpi-worker-cxx.exe cpi-worker-f90.exe

build: ${MASTERS} ${WORKERS}

LANGS=py c cxx f90
test: build
	@for i in ${LANGS}; do \
	    for j in ${LANGS}; do \
                 ./cpi-master-$$i.exe ./cpi-worker-$$j.exe; \
	    done; \
	done 

clean:
	${RM} -r ${MASTERS} ${WORKERS}


MPICC=mpicc
MPICXX=mpicxx
MPIF90=mpif90

# Python
cpi-master-py.exe: cpi-master.py
	echo '#!'`which python` > $@
	cat $< >> $@
	chmod +x $@
cpi-worker-py.exe: cpi-worker.py
	echo '#!'`which python` > $@
	cat $< >> $@
	chmod +x $@

# C
cpi-master-c.exe: cpi-master.c
	${MPICC} $< -o $@
cpi-worker-c.exe: cpi-worker.c
	${MPICC} $< -o $@

# C++
cpi-master-cxx.exe: cpi-master.cxx
	${MPICXX} $< -o $@
cpi-worker-cxx.exe: cpi-worker.cxx
	${MPICXX} $< -o $@

# Fortran 90
cpi-master-f90.exe: cpi-master.f90
	${MPIF90} $< -o $@
cpi-worker-f90.exe: cpi-worker.f90
	${MPIF90} $< -o $@