forked from cadets/build-meta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-everything.sh
executable file
·91 lines (63 loc) · 1.73 KB
/
build-everything.sh
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
#!/bin/sh
TOP=`pwd`
: ${LOGS:="${TOP}/logs"}
mkdir -p ${LOGS}
: ${BUILD_TYPE:="Release"}
export CMAKE="cmake -G Ninja -D CMAKE_BUILD_TYPE=${BUILD_TYPE}"
echo "Building CADETS LLVM and FreeBSD in ${TOP}"
#
# Build LLVM and add it to the PATH
#
cd ${TOP}/llvm
mkdir -p build/${BUILD_TYPE} && cd build/${BUILD_TYPE}
export LLVM_PREFIX=`pwd`
echo ""
echo "Building LLVM in ${LLVM_PREFIX}"
echo -n "Configuring... "
env > ${LOGS}/llvm-config.env
${CMAKE} ../.. 2>&1 > ${LOGS}/llvm-config.log || exit 1
echo "done."
echo -n "Building... "
nice ninja || exit 1
export PATH=${LLVM_PREFIX}/bin:$PATH
#
# Build LLVM Loom using our newly-built LLVM
#
cd ${TOP}/loom
mkdir -p build/${BUILD_TYPE} && cd build/${BUILD_TYPE}
export LOOM_PREFIX=`pwd`
echo ""
echo "Building LLVM Loom in ${LOOM_PREFIX}"
echo -n "Configuring... "
env > ${LOGS}/loom-config.env
${CMAKE} ../.. 2>&1 > ${LOGS}/loom-config.log || exit 1
echo "done."
echo -n "Building... "
nice ninja || exit 1
#
# Build llvm-prov
#
cd ${TOP}/llvm-prov
mkdir -p build/${BUILD_TYPE} && cd build/${BUILD_TYPE}
export LLVM_PROV_PREFIX=`pwd`
echo ""
echo "Building llvm-prov in ${LLVM_PROV_PREFIX}"
echo -n "Configuring... "
env > ${LOGS}/llvm-prov-config.env
${CMAKE} ../.. 2>&1 > ${LOGS}/llvm-prov-config.log || exit 1
echo "done."
echo -n "Building... "
nice ninja || exit 1
export LLVM_PROV_MAKE=${TOP}/llvm-prov/scripts/llvm-prov-make
#
# Finally, build FreeBSD with llvm-prov:
#
#export LLVM_PROV_LIB=${TOP}/llvm-prov/build/${BUILD_TYPE}/lib/LLVMProv.so
echo ""
echo "Building FreeBSD from `pwd`"
LOGFILE=${LOGS}/freebsd-build.log
echo "Logging to: ${LOGFILE}"
echo "OBJDIR: `make -V .OBJDIR`"
time ${TOP}/cadets-ci/scripts/cadets-build.sh ${TOP}/freebsd > ${LOGFILE}
echo ""
echo "All done!"