-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathall_project_build.sh
48 lines (45 loc) · 940 Bytes
/
all_project_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
#!/bin/bash
CMDNAME=`basename $0`
if [[ $1 = "help" ]]; then
echo "Usage: $CMDNAME [clean]"
echo ""
exit
fi
RED=`tput setaf 1`
GREEN=`tput setaf 2`
PINK=`tput setaf 5`
LIGHTBLUE=`tput setaf 6`
NOCOLOR=`tput sgr0`
# make clean
if [[ $1 = "clean" ]]; then
for file in `ls -d *`
do
if [ -e "${file}/Makefile" ]; then
cd "${file}"
echo "${GREEN}Clean project: " ${file} "${NOCOLOR}"
make clean >& /dev/null
if [ $? -ne 0 ]; then
echo "${RED}Error: " ${file} "${NOCOLOR}"
echo ""
break;
fi
cd ..
fi
done
fi
# make
for file in `ls -d *`
do
if [ -e "${file}/Makefile" ]; then
echo "${PINK}Start project: " ${file} "${NOCOLOR}"
cd "${file}"
make > /dev/null
if [ $? -ne 0 ]; then
echo "${RED}Compile error: " ${file} "${NOCOLOR}"
echo ""
break;
fi
cd ..
echo "${LIGHTBLUE}Build project: " ${file} "${NOCOLOR}"
fi
done