File: makefile

package info (click to toggle)
mpi4py 1.3%2Bhg20120611-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,020 kB
  • sloc: python: 9,503; ansic: 6,296; makefile: 571; f90: 158; sh: 146; cpp: 103
file content (26 lines) | stat: -rw-r--r-- 648 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
.PHONY: default build test clean

default: build test clean

PYTHON = python
PYTHON_PERFIX = ${shell ${PYTHON} -c 'import sys; print(sys.exec_prefix)'}
PYTHON_VERSION = ${shell ${PYTHON} -c 'import sys; print(sys.version[:3])'}
PYTHON_CONFIG = ${PYTHON_PERFIX}/bin/python$(PYTHON_VERSION)-config

MPICC   = mpicc
CFLAGS  = ${shell ${PYTHON_CONFIG} --cflags}
LDFLAGS = ${shell ${PYTHON_CONFIG} --ldflags}
LDLAST  = -Xlinker -export-dynamic
build: helloworld.exe
helloworld.exe: helloworld.c
	${MPICC} ${CFLAGS} ${LDFLAGS} ${LDLAST} -o $@ $<


MPIEXEC = mpiexec
NP = -n 5
test: build
	${MPIEXEC} ${NP} ./helloworld.exe


clean:
	${RM} helloworld.exe