-
Notifications
You must be signed in to change notification settings - Fork 2
/
build_freertos.sh
executable file
·89 lines (77 loc) · 2.14 KB
/
build_freertos.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
set -e
TOP_DIR="$( cd "$(dirname "$0")" ; pwd -P )/cvitek"
TOOLCHAIN_FILE_PATH=$TOP_DIR/scripts/toolchain-aarch64-elf.cmake
BUILD_PATH=$TOP_DIR/build
INSTALL_PATH=$TOP_DIR/install
#RUN_TYPE=CVIRTOS or BLINKY_DEMO or FULL_DEMO or POSIX_DEMO
RUN_TYPE=CVIRTOS
RUN_CHIP=cv1835
echo "RUN TYPE: " $RUN_TYPE
# clean build and install folder for clean build
rm -rf $BUILD_PATH $INSTALL_PATH
if [ ! -e $BUILD_PATH/arch ]; then
mkdir -p $BUILD_PATH/arch
fi
pushd $BUILD_PATH/arch
cmake -G Ninja -DCHIP=$RUN_CHIP \
-DTOP_DIR=$TOP_DIR \
-DRUN_TYPE=$RUN_TYPE \
-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE_PATH \
$TOP_DIR/arch
cmake --build . --target install -- -v
popd
if [ ! -e $BUILD_PATH/kernel ]; then
mkdir -p $BUILD_PATH/kernel
fi
pushd $BUILD_PATH/kernel
cmake -G Ninja -DCHIP=$RUN_CHIP \
-DTOP_DIR=$TOP_DIR \
-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE_PATH \
$TOP_DIR/kernel
cmake --build . --target install -- -v
popd
if [ ! -e $BUILD_PATH/common ]; then
mkdir -p $BUILD_PATH/common
fi
pushd $BUILD_PATH/common
cmake -G Ninja -DCHIP=$RUN_CHIP \
-DTOP_DIR=$TOP_DIR \
-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE_PATH \
$TOP_DIR/common
cmake --build . --target install -- -v
popd
if [ ! -e $BUILD_PATH/hal ]; then
mkdir -p $BUILD_PATH/hal
fi
pushd $BUILD_PATH/hal/
cmake -G Ninja -DCHIP=$RUN_CHIP \
-DTOP_DIR=$TOP_DIR \
-DRUN_TYPE=$RUN_TYPE \
-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE_PATH \
$TOP_DIR/hal/$RUN_CHIP
cmake --build . --target install -- -v
popd
if [ ! -e $BUILD_PATH/driver ]; then
mkdir -p $BUILD_PATH/driver
fi
pushd $BUILD_PATH/driver
cmake -G Ninja -DCHIP=$RUN_CHIP \
-DTOP_DIR=$TOP_DIR \
-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE_PATH \
$TOP_DIR/driver
cmake --build . --target install -- -v
popd
if [ ! -e $BUILD_PATH/task ]; then
mkdir -p $BUILD_PATH/task
fi
pushd $BUILD_PATH/task
cmake -G Ninja -DCHIP=$RUN_CHIP \
-DRUN_TYPE=$RUN_TYPE \
-DTOP_DIR=$TOP_DIR \
-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE_PATH \
$TOP_DIR/task
cmake --build . --target install -- -v
cmake --build . --target cvirtos.bin -- -v
popd
cp $TOP_DIR/install/bin/cvirtos.bin ./cvirtos.bin