forked from WENO-OF/WENOEXT
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Allwmake
executable file
·50 lines (40 loc) · 2.44 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
43
44
45
46
47
48
49
50
#!/bin/bash
export GIT_BUILD=$(git describe --always HEAD)
echo "Current OpenFOAM version is $WM_PROJECT_VERSION."
if [ -e foamVersionThisIsCompiledFor ]; then
prevVersion=$(<foamVersionThisIsCompiledFor)
echo "Previously compiled for OpenFOAM ($prevVersion)"
if [ "$WM_PROJECT_VERSION" != "$prevVersion" ]
then
echo "Different than current OpenFOAM ($WM_PROJECT_VERSION) version."
echo " Use ./Allwclean before compiling"
exit 42
fi
unset prevVersion
else
echo "This is a clean install"
echo $WM_PROJECT_VERSION >foamVersionThisIsCompiledFor
fi
versionFile=versionRules/foamVersion4weno.H
versionRules/makeFoamVersionHeader.py $WM_PROJECT_VERSION >$versionFile.tmp
if [ -e $versionFile ]; then
nrDiff=$(diff $versionFile.tmp $versionFile | wc -l | tr -d " ")
if [[ $nrDiff > 0 ]]; then
echo "$versionFile changed"
mv $versionFile.tmp $versionFile
else
# Make sure that not a complete recompilation is triggered
echo "No change to $versionFile"
rm $versionFile.tmp
fi
else
echo "No $versionFile. Generating!"
mv $versionFile.tmp $versionFile
fi
# Ensure consistent definition of OPENFOAM_COM without relying anything else.
# This may be available from the regular wmake rules, but use our own convention
sed -ne 's/.*WMLES_IS_COM \([0-9][0-9]*\)/OPENFOAM_COM=\1/p' < $versionFile > versionRules/foamVersion
echo
echo "Please include the output above when reporting a problem in the compilation. It helps diagnosing the problem "
echo
wmake libso libWENOEXT