Debian Codegraph @

demo/spawning/makefile

raw symbols SCIP
1 include ../config.mk
2 .PHONY: default build test clean
3 default: build test clean
4
5 LANGS = py c cxx f90
6 MASTERS = $(foreach lang,$(LANGS),cpi-master-$(lang).exe)
7 WORKERS = $(foreach lang,$(LANGS),cpi-worker-$(lang).exe)
8
9 build: $(MASTERS) $(WORKERS)
10
11 MPIEXEC = mpiexec -n 1
12 test: build
13 @for i in $(LANGS); do \
14 for j in $(LANGS); do \
15 $(MPIEXEC) ./cpi-master-$$i.exe ./cpi-worker-$$j.exe; \
16 done; \
17 done
18
19 clean:
20 $(RM) -r $(MASTERS) $(WORKERS) __pycache__
21
22
23 # Python
24 cpi-master-py.exe: cpi-master.py
25 echo '#!'`which python` > $@
26 cat $< >> $@
27 chmod +x $@
28 cpi-worker-py.exe: cpi-worker.py
29 echo '#!'`which python` > $@
30 cat $< >> $@
31 chmod +x $@
32
33 # C
34 cpi-master-c.exe: cpi-master.c
35 $(MPICC) $< -o $@
36 cpi-worker-c.exe: cpi-worker.c
37 $(MPICC) $< -o $@
38
39 # C++
40 cpi-master-cxx.exe: cpi-master.cxx
41 $(MPICXX) $< -o $@
42 cpi-worker-cxx.exe: cpi-worker.cxx
43 $(MPICXX) $< -o $@
44
45 # Fortran 90
46 cpi-master-f90.exe: cpi-master.f90
47 $(MPIFORT) $< -o $@
48 cpi-worker-f90.exe: cpi-worker.f90
49 $(MPIFORT) $< -o $@