forked from HaikuArchives/Paladin
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuildsuite.sh
More file actions
executable file
·83 lines (70 loc) · 1.84 KB
/
buildsuite.sh
File metadata and controls
executable file
·83 lines (70 loc) · 1.84 KB
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
#!/bin/sh
START_DIRECTORY=`pwd`
# ----------------------------------------------------------------------------
# SETUP
# ----------------------------------------------------------------------------
if [ -z "$1" ]
then
echo "usage: $0 <cpucount>"
exit -1;
else
CPUCOUNT=$1
fi
if [ "$2" == "clean" ]
then
MAKECLEAN=1
else
MAKECLEAN=0
fi
# This function creates a temporary project from which we make
# sure that the target is being built without debugging enabled
BuildNoDebug ()
{
if [ -z "$1" ]
then
echo "Function BuildNoDebug called without parameter\n"
exit -1
fi
PROJEXT=".pld"
TEMPEXT=".nodebug.pld"
PROJNAME=$1$PROJEXT
TMPPROJ=$1$TEMPEXT
echo "Building temporary project $TMPPROJ"
OBJDIRNAME='(Objects.'$1'.nodebug)'
mkdir -p $OBJDIRNAME
# do build here
# using absolute paths here because chroot folder for some reasons that are
# unknown to me includes /system/develop, but does not contain /boot/system/develop
sed 's/CCDEBUG=yes//' "$PROJNAME" | sed 's/CCOPLEVEL=[0-9]/CCOPLEVEL=3/' | sed 's_/boot/develop_/system/develop_' | sed 's_/system/develop/headers/cpp_/system/develop/headers/c++_' | sed 's_/system/develop/lib/x86_/system/develop/lib_' > "$TMPPROJ"
$START_DIRECTORY/Paladin/Paladin -b "$TMPPROJ"
SUCCESS=$?
if [ "$MAKECLEAN" == 1 ]
then
rm "$TMPPROJ"
if [ -d "$OBJDIRNAME" ]
then
rm -r "$OBJDIRNAME"
fi
fi
if [ "$SUCCESS" -ne 0 ]
then
echo "Failed to build $TMPPROJ. Error code $SUCCESS"
exit 2;
else
echo "$PROJNAME has been built"
fi
}
# ----------------------------------------------------------------------------
# BUILD
# ----------------------------------------------------------------------------
# Attempt to build Paladin
cd Paladin
rm -f Paladin Paladin.new
echo "Building Paladin"
make -j$CPUCOUNT
make catkeys
make bindcatalogs
cd ../
cd SymbolFinder
BuildNoDebug SymbolFinder
cd ..