-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAllwmake
executable file
·42 lines (34 loc) · 1.03 KB
/
Allwmake
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
#!/bin/bash
cd ${0%/*} || exit 1 # run from this directory
# Stop the script if a command returns an error code
# trap "exit -1" ERR
set -e
trap 'catch $? $LINENO' EXIT
catch() {
if [ "$1" != "0" ]; then
# error handling goes here
echo "Error $1 occurred on $2"
fi
}
if [ "$PWD" != "$WM_PROJECT_DIR" ]
then
echo "Error: Current directory is not \$WM_PROJECT_DIR"
echo " The environment variable are not consistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
fi
# wmake is required for subsequent targets
( cd wmake/src && make )
# build ThirdParty sources
# ( cd $WM_THIRD_PARTY_DIR && ./AllMake )
# We make sure the ThirdParty packages environment variables are up-to-date
# before compiling the rest of OpenFOAM
. $WM_PROJECT_DIR/etc/settings.sh
# build OpenFOAM libraries and applications
src/Allwmake
applications/Allwmake
if [ "$1" = doc ]
then
doc/Allwmake
fi
# ----------------------------------------------------------------- end-of-file