-
Notifications
You must be signed in to change notification settings - Fork 5
/
make-all
executable file
·47 lines (40 loc) · 1.17 KB
/
make-all
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
#!/bin/sh
#
# This file is distributed under the terms of the MIT License.
# See the LICENSE file at the top of this tree, or if it is missing a copy can
# be found at http://opensource.org/licenses/MIT
#
# Make everything
dir=$(dirname $0)
cd "${dir}"
MAKE=make
which gmake >/dev/null 2>&1 && MAKE=gmake
export MAKE
export LD_LIBRARY_PATH=
#MAKE_PARALLEL=-j4 # TODO: make this depend on if it's in CI
do_bootstrap=
if [ -f configure ]; then
# Find if any autotools input is newer than configure
if find . -type f '(' -name 'Makefile.*' -or -name 'configure.*' -or -name '*.in' ')' -newer configure | grep -q "."; then
echo "- autotools out of date; bootstrap required"
do_bootstrap=y
fi
# Find if any autotools output file is missing
outputs=$(eval $(grep ^ac_config_files= configure); echo $ac_config_files)
for i in ${outputs}; do
if [ ! -f "$i" ]; then
echo "- '$i' is missing; bootstrap required"
do_bootstrap=y
fi
done
else
echo "- 'configure' is missing; bootstrap required"
do_bootstrap=y
fi
if [ "${do_bootstrap}" ]; then
[ -f Makefile ] && $MAKE $MAKE_PARALLEL clean
./bootstrap
./do-configure-debug
$MAKE $MAKE_PARALLEL clean
fi
exec $MAKE $MAKE_PARALLEL