-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·63 lines (54 loc) · 1.35 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
#!/bin/bash
#shellcheck disable=SC2034
#shellcheck disable=SC2086
#shellcheck disable=SC2046
#shellcheck disable=SC2155
export INSTALL_PATH=$(pwd)/INSTALL
build_rtems_tools()
{
pushd rtems/tools >> /dev/null || exit
./waf distclean
./waf configure --prefix=${PREFIX_PATH}
./waf build -j$(nproc)
./waf install
popd >> /dev/null || exit
}
build_rtems_sdk()
{
pushd rtems/rtems >> /dev/null || exit
./waf distclean
echo -e ${CFG_FILE} > config.ini
./waf configure --prefix=${PREFIX_PATH}
./waf -j$(nproc)
./waf install
popd >> /dev/null || exit
}
build_rtems_bsd()
{
pushd rtems/libbsd >> /dev/null || exit
echo -e ${CFG_FILE} > config.ini
./waf configure --prefix=${PREFIX_PATH}
./waf -j$(nproc)
./waf install
popd >> /dev/null || exit
}
build_rtems_demo()
{
pushd rtems/examples >> /dev/null || exit
./waf configure --rtems=${PREFIX_PATH} \
--rtems-tools=${PREFIX_PATH}\
--rtems-bsps=${RTMES_ARCH}/${RTMES_BSP}
./waf -j$(nproc)
popd >> /dev/null || exit
}
export RTMES_ARCH=$1
export RTMES_BSP=$2
export PREFIX_PATH=${INSTALL_PATH}/rtems-${RTMES_ARCH}
export PATH=$PATH:${PREFIX_PATH}/bin
export CFG_FILE="[${RTMES_ARCH}/${RTMES_BSP}]"
build_rtems_tools
build_rtems_sdk
if [ ${RTMES_ARCH} == aarch64 ]; then
build_rtems_bsd
fi
build_rtems_demo