forked from johnath/beep
-
Notifications
You must be signed in to change notification settings - Fork 11
/
testbuild-all
executable file
·63 lines (53 loc) · 1.29 KB
/
testbuild-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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh
cd "$(dirname "$0")"
export LC_ALL=C
set -ex
# We need to remove the built files from the $(srcdir) in order to
# make the VPATH search work properly for the test builds.
make clean
while read id cc cflags
do
abs_top_srcdir="$PWD"
builddir="$PWD/_build-$id"
prefix="$PWD/_prefix-$id"
rm -rf "$builddir" "$prefix"
(
mkdir "$builddir"
cd "$builddir"
srcdir="${abs_top_srcdir}"
cat>local.mk<<EOF
VPATH = $srcdir
srcdir = $srcdir
CC = $cc
CFLAGS = $cflags
CPPFLAGS = -I. -I$srcdir
prefix = $prefix
EOF
run_make() {
make -j -f "$srcdir/GNUmakefile" "$@"
}
run_make
run_make check
run_make install-nobuild
(cd "$prefix" && find . -type f | sort) > after-installation.txt
nl after-installation.txt
if test -s after-installation.txt; then
:
else
echo "Error: After installation, there should be files installed."
exit 1
fi
run_make uninstall
(cd "$prefix" && find . -type f | sort) > after-uninstall.txt
nl after-uninstall.txt
if test -s after-uninstall.txt; then
echo "Error: After uninstall, there should be no files left."
exit 1
fi
)
done <<EOF
native-clang clang -Dbuilt_with="clang"
native-gcc gcc -Dbuilt_with="gcc"
EOF
# Note that at this time, the cflags part of the parameter list is
# only used as a placeholder.