forked from LiteOS/LiteOS_Lab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.ci-build.sh
More file actions
66 lines (55 loc) · 1.04 KB
/
Copy path.ci-build.sh
File metadata and controls
66 lines (55 loc) · 1.04 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
#!/bin/bash
set -o errexit
function do_build ()
{
eval $1
if [ $? -ne 0 ]
then
echo "Build fail! Exiting the build!"
echo "Build command:"
echo "$1"
exit $?
fi
}
function gcc_build ()
{
echo "building $1 with default config"
do_build "make -j2 -C $1 > /dev/null"
config="$1/config_demos"
if [ -d "$config" ]
then
for c in $config/*.mk
do
f="config_demos/`basename $c`"
if [ -f "$1/$f" ]
then
make clean -C $1
echo "building $1 with config = $f"
do_build "make -j2 -C $1 CONFIG_FILE=$f > /dev/null"
fi
done
fi
}
function build_target ()
{
if [ -f "$1/Makefile" ]
then
gcc_build $1
else
itr_target $1
fi
}
function itr_target ()
{
if [ -d "$1" ]
then
for t in $1/*
do
if [ -d "$t" ]
then
build_target $t
fi
done
fi
}
itr_target "./targets"