-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·64 lines (54 loc) · 1.26 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
#!/bin/bash
# Check for ccache
if command -v ccache > /dev/null; then
export CROSS_COMPILE="ccache mipsel-linux-"
else
export CROSS_COMPILE="mipsel-linux-"
fi
# Check if the -clean flag is set
if [[ "$1" == "" ]]; then
echo "run with --make or --clean"
exit 0
elif [[ "$1" == "--clean" ]]; then
MAKE_CMD="make distclean"
rm -f ingenic_musl/musl_shim.o
elif [[ "$1" == "--make" ]]; then
MAKE_CMD="make"
else
echo "Invalid command"
exit 1
fi
# Define the list of base directories
folders=("A1" "T20" "T21" "T23" "T30" "T31" "T40" "T41")
# Iterate over each folder
for folder in "${folders[@]}"; do
echo "Processing folder: $folder"
# Change to the folder and remember to return later
pushd "$folder"
# libimp
if [ -d "libimp" ]; then
pushd "libimp"
$MAKE_CMD
popd # Return from libimp
else
echo "libimp directory does not exist in $folder"
fi
# libsysutils
if [ -d "libsysutils" ]; then
pushd "libsysutils"
$MAKE_CMD
popd # Return from libsysutils
else
echo "libsysutils directory does not exist in $folder"
fi
# libivs_inf
if [ -d "libivs_inf" ]; then
pushd "libivs_inf"
$MAKE_CMD
popd # Return from libivs_inf
else
echo "libivs_inf directory does not exist in $folder"
fi
popd # Return to the starting directory
done
echo "All done."