forked from ivanallen/Titans
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
49 lines (43 loc) · 743 Bytes
/
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
#!/bin/bash
function get_files() {
for file in `ls $1`;
do
if [ -d $1/$file ]; then
get_files "$1/$file"
else
if [ -d $1 ]; then
echo $1/$file
else
echo $file
fi
fi
done
}
function build() {
dir=`dirname $1`
filename=`basename $1`
if [[ $filename != "Makefile" ]]; then
return
fi
pushd $dir
echo "build in $dir"
make
if [[ $? != 0 ]]; then
echo "build error in '$dir'"
popd
exit 1
fi
popd
}
list='.'
[ -n "$*" ] && list=$*
files=""
for e in $list
do
files="$files `get_files $e`"
done
for file in $files;
do
#echo $file
build $file
done