-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMAKEALL
executable file
·87 lines (77 loc) · 1.92 KB
/
MAKEALL
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
#!/bin/sh
if [ "$1" = "-p" ] ; then
pretend=true
shift
else
pretend=false
fi
MAKE=${MAKE:-make}
LOG_DIR="LOG"
arches="$@"
if [ -z "$arches" ] ; then
all_arches=$(
cd vendors/config
echo */config.arch | sed 's:/config.arch::g'
)
arches=""
for arch in ${all_arches} ; do
CROSS_COMPILE=$(
var="CROSS_COMPILE"
makefile="vendors/config/${arch}/config.arch"
export ROOTDIR=$PWD
echo -e "e:\\n\\t@echo \$(${var})\\ninclude ${makefile}" | \
${MAKE} --no-print-directory -s -f - 2>/dev/null
)
if [ -n "$CROSS_COMPILE" ] ; then
if ${CROSS_COMPILE}gcc -v 2>/dev/null 1>&2 ; then
arches="${arch} ${arches}"
echo "Adding ${arch} to build list"
else
echo "Skipping ${arch}: unable to find '${CROSS_COMPILE}gcc'"
fi
elif [ "${arch}" != "host" -a "${arch}" != "common" ] ; then
echo "Skipping ${arch}: does not define CROSS_COMPILE"
fi
done
echo
fi
mkdir -p "${LOG_DIR}"
PASS=""
FAIL=""
for arch in ${arches} ; do
list=$(
cd vendors
grep -l ${arch}/config.arch */*/config.arch | sed 's:/config.arch::g'
)
echo "Building boards:"
echo " `echo ${list} | sed 's: :\n :g'`"
echo
for board in ${list} ; do
sanitized=$(echo "${board}" | sed s:/:_:g)
log="${LOG_DIR}/${sanitized}.log"
imgs="${LOG_DIR}/${sanitized}"
rm -rf "${log}"{,.FAIL} "${imgs}" images
printf "#### BUILDING BOARD: ${board}: "
if ${pretend} || ${MAKE} ${board}_default > "${log}" 2>&1 ; then
echo PASS
PASS="${PASS} ${board}"
if ! ${pretend} ; then
rsync -a --delete images/ "${imgs}"
fi
else
echo FAIL
FAIL="${FAIL} ${board}"
printf "\n\nSingle target ...\n\n" >> "${log}"
${MAKE} single >> "${log}" 2>&1
${MAKE} single > "${log}".FAIL 2>&1
fi
${pretend} || svn st > "${log}".svn
done
done
cat <<EOF
These boards passed:
`echo ${PASS:-no passes here} | sed 's: :\n :g'`
These boards failed:
`echo ${FAIL:-no failures here} | sed 's: :\n :g'`
EOF
[ -n "${FAIL}" ] && exit 1 || exit 0