blob: df50919a65f6eb12deac4f86c8e13f4b0413d242 (
plain)
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
|
#!/bin/sh -e
#
# Copyright (C) 2011, BMW AG
#
# AudioManagerDeamon
#
# @file cmaker.sh
#
# @date: 20.05.2011
# @author: Christian Müller (christian.ei.mueller@bmw.de)
#
# Shell script to envoke the out of source build of the Audiomanager and create documentation
# after invoking this script, first all Plugins will be compiled and the resulting .a files
# are found in ./build/plugins.
# All binaries are found in ./bin
# Finally source documentation can be found in ./doc
# to do a clean build, just remove the ./build folder or just a subfolder in this build folder.
BUILD_DIRECTORY="build"
PLUGINS_DIRECTORY="plugins"
DOC_DIRECTORY="doc"
BIN_DIRECTORY="bin"
ACTION=$1
ABS=`exec pwd`
APPLICATION_LIST=$(find . -maxdepth 1 -type d \( -name "[A-Z]*" -a -not \( -name "Plugin*" \) \) )
PLUGIN_LIST=$(find . -maxdepth 1 -type d \( -name "[A-Z]*" -a -name "Plugin*" \) )
# checks for Build directory and creates it if neccessary
make_build ()
{
BIN=$ABS"/"$BIN_DIRECTORY
if [ ! -d "${BIN}" ];
then
echo "create Bin Dir: $BIN_DIRECTORY"
mkdir $BIN_DIRECTORY
cd $BIN_DIRECTORY
cp ../AudioManGUI/Bild1.png .
cd ..
fi
ABSOLUTE=$ABS"/"$BUILD_DIRECTORY
if [ ! -d "${ABSOLUTE}" ];
then
echo "create Build Dir: $BUILD_DIRECTORY"
mkdir $BUILD_DIRECTORY
fi
cd "${ABSOLUTE}"
if [ ! -d "${PLUGINS_DIRECTORY}" ];
then
echo "create Build Dir: $PLUGINS_DIRECTORY"
mkdir $PLUGINS_DIRECTORY
fi
}
# does cmake for list in $1
do_cmake_plugin ()
{
for PL in $PLUGIN_LIST
do
echo $PL
done
for PL in $PLUGIN_LIST
do
if [ ! -d "$PL" ]; then
mkdir $PL
fi
cd $PL
p=$ABS"/"${PL#"./"}
cmake $p
cd ..
done
}
do_cmake_app ()
{
for PL in $APPLICATION_LIST
do
echo $PL
done
for PL in $APPLICATION_LIST
do
if [ ! -d "$PL" ]; then
mkdir $PL
fi
cd $PL
p=$ABS"/"${PL#"./"}
cmake $p
cd ..
done
}
# does make for list in $1
do_make_plugin ()
{
for PL in $PLUGIN_LIST
do
echo $PL
done
for PL in $PLUGIN_LIST
do
if [ ! -d "$PL" ]; then
mkdir $PL
fi
cd $PL
make -j4
cd ..
done
}
do_make_app ()
{
for PL in $APPLICATION_LIST
do
echo $PL
done
for PL in $APPLICATION_LIST
do
if [ ! -d "$PL" ]; then
mkdir $PL
fi
cd $PL
make -j4
cd ..
done
}
all ()
{
case "$1" in
cmake)
do_cmake_plugin
do_cmake_app
;;
make)
do_make_plugin
do_make_app
;;
all)
do_cmake_plugin
do_make_plugin
do_cmake_app
do_make_app
;;
esac
}
main ()
{
case "$1" in
cmake)
do_cmake_app
;;
make)
do_make_app
;;
all)
do_cmake_app
do_make_app
;;
esac
}
plugins ()
{
case "$1" in
cmake)
do_cmake_plugin
;;
make)
do_make_plugin
;;
all)
do_cmake_plugin
do_make_plugin
;;
esac
}
target ()
{
b=$2
if [ ! -d "$2" ]; then
mkdir $2
fi
case "$1" in
cmake)
cd $b
p=$ABS"/"${b#"./"}
cmake $p
;;
make)
cd $b
make -j4
;;
all)
cd $b
p=$ABS"/"${b#"./"}
cmake $p;
make -j4
;;
esac
}
case "$ACTION" in
cmake)
echo "...executing cmake for"
;;
make)
echo "...executiong make for"
;;
all)
echo "...executing cmake & make for"
;;
*)
echo ""
echo " Usage: ./cmaker.sh {cmake|make|all} {all|main|plugins|target xxx} [document]"
echo " xxx stands for the directory of the target to be build"
echo " Output binaries are below \bin, builds are done in \build\xxx"
echo " Script does only use Subdirectories beginning with upper Cases !"
echo " document if this flag is present, the documentation will be created"
echo ""
exit 1
;;
esac
echo "$3"
doc="document"
if [ "$3" = "$doc" ]
then
export gendoc="ON"
else
export gendoc="OFF"
fi
make_build
case "$2" in
all)
all $ACTION
;;
applications)
main $ACTION
;;
plugins)
plugins $ACTION
;;
target)
target $ACTION $3
;;
*)
echo ""
echo " Usage: ./cmaker.sh {cmake|make|all} {all|applications|plugins|target xxx} [-document]"
echo " xxx stands for the directory of the target to be build"
echo " Output binaries are below \bin, builds are done in \build\xxx"
echo " Script does only use Subdirectories beginning with upper Cases !"
echo " document if this flag is present, the documentation will be created"
echo ""
exit 1
;;
esac
exit 0
|