forked from OpenFOAM/ThirdParty-2.1.x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakeMake
executable file
·125 lines (110 loc) · 3.35 KB
/
makeMake
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/bin/sh
#------------------------------------------------------------------------------
# License
# This file is part of blueCAPE's unofficial mingw patches for OpenFOAM.
# For more information about these patches, visit:
# http://www.bluecape.com.pt/blueCFD
#
# It's based on the file with the same name available here:
# https://github.com/wyldckat/ThirdParty-2.0.x/tree/binutils
#
# OpenFOAM's official site: http://www.openfoam.com
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# makeMake
#
# Description
# Build script for Make
#
#------------------------------------------------------------------------------
makePACKAGE=`. etc/defaults.sh ; echo make-\$make_version`
gccPACKAGE=`. etc/defaults.sh ; echo \$gcc_version`
#------------------------------------------------------------------------------
# run from third-party directory only
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [make-VERSION] [gcc-VERSION]
* build combinations of make and currently built gcc
$makePACKAGE
$gccPACKAGE
USAGE
exit 1
}
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
make-[2-9]*)
makePACKAGE="${1%%/}"
shift
;;
gcc-[4-9]*)
gccPACKAGE="${1%%/}"
shift
;;
*)
usage "unknown option/argument: '$*'"
;;
esac
done
#------------------------------------------------------------------------------
# build/install without compiler name
buildBASE=$WM_THIRD_PARTY_DIR/build/$WM_ARCH$WM_COMPILER_ARCH
installBASE=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH
MAKE_ARCH_PATH=$installBASE/$gccPACKAGE
#
# Build Make
#
echo "---------------"
if [ ! -d $MAKE_ARCH_PATH ]
then
echo "$gccPACKAGE isn't built yet."
else
echo "Starting build: $makePACKAGE"
echo
(
sourceDIR=$WM_THIRD_PARTY_DIR/$makePACKAGE
buildDIR=$buildBASE/$makePACKAGE
cd $sourceDIR || exit 1
make distclean 2>/dev/null
rm -rf $buildDIR
mkdir -p $buildDIR
cd $buildDIR
set -x
$sourceDIR/configure \
--prefix=$MAKE_ARCH_PATH \
&& make -j $WM_NCOMPPROCS \
&& make install \
&& echo "Built: $makePACKAGE"
) || {
echo "Error building: $makePACKAGE"
exit 1
}
fi
# ----------------------------------------------------------------- end-of-file