forked from RTEMS/rtems
-
Notifications
You must be signed in to change notification settings - Fork 2
/
rtems-bsps
executable file
·49 lines (41 loc) · 1.16 KB
/
rtems-bsps
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/sh
top=$(dirname $0)
base="${top}/bsps"
base_e=$(echo ${base} | sed -e 's/\//\\\//g')
last_arch=""
cfg_list=$(LANG=C LC_COLLATE=C find ${base} -mindepth 3 -name \*.cfg | sort)
max_bsp_len=0
arch_count=0
bsp_count=0
for bsp_path in ${cfg_list};
do
arch=$(echo ${bsp_path} | sed -e "s/${base_e}*\///" -e 's/\/.*//')
bsp=$(echo ${bsp_path} | sed -e "s/.*\///" -e 's/\.cfg//')
len=${#bsp}
if test "${last_arch}" != "${arch}"; then
arch_count=$(expr ${arch_count} + 1)
last_arch=${arch}
fi
if [ $len -gt $max_bsp_len ]; then
max_bsp_len=$len
fi
bsp_count=$(expr ${bsp_count} + 1)
done
max_bsp_len=$(expr ${max_bsp_len} + 2)
last_arch=""
echo "RTEMS 5"
echo " Architectures: ${arch_count}"
echo " BSP Count: ${bsp_count}"
for bsp_path in ${cfg_list};
do
arch=$(echo ${bsp_path} | sed -e "s/${base_e}*\///" -e 's/\/.*//')
bsp=$(echo ${bsp_path} | sed -e "s/.*\///" -e 's/\.cfg//')
path=$(echo ${bsp_path} | sed -e "s/\/config.*//")
if test "${last_arch}" != "${arch}"; then
echo "${arch}:"
last_arch=${arch}
fi
spaces=$(echo ${bsp} | awk '{ printf("%*s", '${max_bsp_len}' -length(), " "); }')
echo " ${bsp}${spaces}${path}"
done
exit 0