-
Notifications
You must be signed in to change notification settings - Fork 30
/
build.sh
executable file
·122 lines (107 loc) · 2.87 KB
/
build.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
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
#!/bin/bash
set -e
exec > >(tee compilation_log.txt)
exec 2>&1
root=`eval pwd`
if [ -e $root/src/exp/inc/src/pwr_version.h ]; then
verl=`eval cat $root/src/exp/inc/src/pwr_version.h | grep "\bpwrv_cPwrVersionStr\b" | awk '{print $3}'`
verl=${verl:1:6}
ver=${verl:0:2}${verl:3:1}${verl:5:1}
fi
# Check pwra
aroot=/usr/local/adm
if [ ! -e $aroot/db ]; then
if mkdir -p $aroot/db 2>/dev/null; then
echo "Administration directory created: $aroot/db"
cp -u $root/src/tools/pkg/deb/adm/pwr* $aroot/db/
else
echo "Unable to create a global administration directory $aroot/db"
aroot=$root/adm
echo "Using local administration directory $aroot/db"
if mkdir -p $aroot/db; then
cp -u $root/src/tools/pkg/deb/adm/pwr* $aroot/db/
else
echo "Unable to create local administration directory $aroot/db"
fi
fi
fi
# Insert base in projectlist
if [ ! -e $aroot/db/pwr_projectlist.dat ]; then
echo "Creating $aroot/db/pwr_projectlist.dat"
echo "%base $verl $root/rls" > $aroot/db/pwr_projectlist.dat
else
set +e
ptst=`eval grep "^%base" $aroot/db/pwr_projectlist.dat | grep "\b$verl\b"`
set -e
if [ "$ptst" = "" ]; then
echo "Adding base to $aroot/db/pwr_projectlist.dat"
echo "%base $verl $root/rls" >> $aroot/db/pwr_projectlist.dat
else
echo "Base $verl already exist in $aroot/db/pwr_projectlist.dat"
fi
fi
# Setup pwre
export pwre_bin=$root/src/tools/pwre/src
export pwre_env_db=$root/pwre_db
source $pwre_bin/pwre_function
# Add pwre environment
unamestr=`eval uname`
machine=`eval uname -m`
if [ $machine == "amd64" ]; then
machine="x86_64"
fi
if [ $machine != "x86_64" ]; then
machine="x86"
fi
if [ $unamestr == "Darwin" ]; then
os="macos"
hw="x86_64"
elif [ $unamestr == "FreeBSD" ]; then
os="freebsd"
hw=$machine
else
os="linux"
hw=$machine
fi
btype="dbg"
ename=$ver$hw
desc=$verl
if [ ! -z $1 ]; then
gui="$1"
else
gui="qt"
fi
if [ $gui == "qt" ]; then
export pwre_conf_qt=1
elif [ $gui == "gtk" ]; then
export pwre_conf_gtk=1
fi
pwre add $ename $root/src \"\" $root/rls $btype $os $hw "$desc"
pwre init $ename
# Build
mkdir -p $pwre_broot
pwre configure --parallel
pwre create_all_modules
pwre build_all_modules $gui
#pwre build_kernel $gui
#pwre method_build $gui
# Create a package version html file
$root/src/tools/pkg/deb/pwrrt/build.sh -v
co_convert -t -d $pwr_doc $pwr_eexe/xtt_version_help.dat
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo ""
echo "Add the following lines to your .bashrc-file"
echo ""
echo "export pwra_db=$aroot/db"
echo "source \$pwra_db/pwr_setup.sh"
echo "pwrp set base $verl"
echo "export PWR_BUS_ID=999"
echo ""
echo "Create a project with pwra"
echo ""
echo "> pwra"
echo ""
echo "Read Getting Started Guide on www.proview.se about how to create"
echo "and configure a project"
echo ""
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"