forked from ImperialCollegeLondon/porefoam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.3rd
73 lines (48 loc) · 2.75 KB
/
makefile.3rd
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
allSubdirs:=$(shell ls -d */ | grep -v [\ \(\)-] | sed 's/\///g')
$(info $(allSubdirs) )
all: zlib $(allSubdirs)
.PHONY: clean $(allSubdirs)
msRoot ?= $(abspath ..)
$(info msRoot set to ${msRoot})
CmakeOpts= -DBUILD_SHARED_LIBS=False -DCMAKE_INSTALL_PREFIX=${msRoot} -DCMAKE_TOOLCHAIN_FILE=${msRoot}/src/script/toolchain${OPT}.txt
ms3rd ?= ${CURDIR}
$(info ms3rd set to ${ms3rd})
msBuild=${msRoot}/build
biltT=$(shell [ -d ${ms3rd}/libtiff ] && [ ! -f ${msRoot}/lib/libtiffxx.a ] && echo Tiff)
libtiff:
[ Tiff != "$(biltT)" ] || (mkdir -p $(msBuild)/libtif )
[ Tiff != "$(biltT)" ] || (cd $(msBuild)/libtif && cmake ${CmakeOpts} ${ms3rd}/libtiff)
[ Tiff != "$(biltT)" ] || (cd $(msBuild)/libtif && $(MAKE) install)
biltHP=$(shell [ -d ${ms3rd}/hypre/src ] && [ ! -f ${msRoot}/lib/libHYPRE.a ] && echo Hypre)
hyprePar:
[ Hypre != "$(biltHP)" ] || (mkdir -p $(msBuild)/hyprePar )
[ Hypre != "$(biltHP)" ] || (cd $(msBuild)/hyprePar && cmake ${CmakeOpts} -DHYPRE_WITH_OPENMP=ON -DHYPRE_WITH_MPI=OFF ${ms3rd}/hypre/src )
[ Hypre != "$(biltHP)" ] || (cd $(msBuild)/hyprePar && $(MAKE) install)
biltH=$(shell [ -d ${ms3rd}/hypre/src ] && [ ! -f ${msRoot}/lib/libHYPRESeq.a ] && echo HypreSq)
hypre:
[ HypreSq != "$(biltH)" ] || (mkdir -p $(msBuild)/hypreSeq )
[ HypreSq != "$(biltH)" ] || (cd $(msBuild)/hypreSeq && cmake -DHYPRE_WITH_MPI=OFF -DHYPRE_SEQUENTIAL=ON ${CmakeOpts} ${ms3rd}/hypre/src )
[ HypreSq != "$(biltH)" ] || (cd $(msBuild)/hypreSeq && $(MAKE) install)
[ HypreSq != "$(biltH)" ] || (mv ${msRoot}/lib/libHYPRE.a ${msRoot}/lib/libHYPRESeq.a)
#hypreDbg:
# (cp -r hypre-2.11.2 hypre-2.11.2Dbg)
# (cd hypre-2.11.2Dbg/src && ./configure --enable-debug --without-MPI --without-fei CC=gcc-6 F77=gfortran CPP=g++-6 CXX=g++ AR=ar\ -rcu RANLIB=ranlib )
# (cd hypre-2.11.2Dbg/src && make)
biltZ=$(shell [ -d ${ms3rd}/zlib ] && [ ! -f ${msRoot}/lib/libz.a ] && echo Zlib)
zlib:
[ Zlib != "$(biltZ)" ] || (mkdir -p $(msBuild)/zlib )
[ Zlib != "$(biltZ)" ] || (cd $(msBuild)/zlib && cmake ${CmakeOpts} ${ms3rd}/zlib)
[ Zlib != "$(biltZ)" ] || (cd $(msBuild)/zlib && $(MAKE) install)
lPng=$(shell [ -d ${ms3rd}/libpng ] && [ ! -f ${msRoot}/lib/libpng.a ] && echo lPng)
libpng:
[ lPng != "$(lPng)" ] || (cd ${ms3rd}/libpng && $(MAKE) all OPT=${OPT})
#zlib:
# [ -f ${msRoot}/include/zfstream.h ] || cp ${ms3rd}/zfstream/zfstream.h ${msRoot}/include/
biltF=$(shell [ -d foamx4m ] && [ ! -f ${msRoot}/lib/libfiniteVolume*.so ] && echo Foam)
foamx4m:
[ Foam != "$(biltF)" ] || (cd foamx4m && ./AllMak${OPT}e)
[ Foam != "$(biltF)" ] || (cd foamx4m && ./AllInstall)
clean:
(cd foamx4m 2>/dev/null && ./AllDistclean) || echo !!
distclean:
(cd foamx4m 2>/dev/null && ./AllDistclean) || echo !!