1.PHONY: default
2default: build test clean
3
4PYTHON = python$(py)
5
6MPICC = mpicc
7LIBNAME = libhelloworld.so
8.PHONY: build
9build: ${LIBNAME}
10${LIBNAME}: helloworld.c
11	${MPICC} -shared -fPIC -o $@ $<
12
13
14MPIEXEC = mpiexec
15NP_FLAG = -n
16NP = 5
17.PHONY: test
18test: build
19	${MPIEXEC} ${NP_FLAG} ${NP} ${PYTHON} test.py
20
21
22.PHONY: clean
23clean:
24	${RM} -r ${LIBNAME} *.pyc __pycache__
25