aboutsummaryrefslogtreecommitdiffstats
path: root/ohoshell.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ohoshell.sh')
-rw-r--r--ohoshell.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/ohoshell.sh b/ohoshell.sh
new file mode 100644
index 0000000..341b5ad
--- /dev/null
+++ b/ohoshell.sh
@@ -0,0 +1,42 @@
1#!/bin/bash
2
3##########################################################################
4# File Name : ohoshell.sh
5# Encoding : utf-8
6# Author : We-unite
7# Email : weunite1848@gmail.com
8# Created Time : 2024-06-07 02:05:05
9##########################################################################
10
11set -e
12native=~/app/native
13
14if [ $# -ne 1 ]; then
15 echo "Usage: $0 <armv7-a | armv8-a>"
16 exit 1
17fi
18
19arch=$1
20
21case $arch in
22 armv8-a)
23 compiler=$native/llvm/bin/aarch64-unknown-linux-ohos-clang
24 targetPlatform=aarch64-linux-ohos
25 ;;
26 armv7-a)
27 compiler=$native/llvm/bin/armv7-unknown-linux-ohos-clang
28 targetPlatform=arm-linux-ohos
29 ;;
30 *)
31 echo "Unsupported arch"
32 exit 1
33 ;;
34esac
35
36flex -o lex.yy.c lex.l
37bison -o syntax.tab.c -d -v syntax.y -Wcounterexamples
38
39$compiler -o bcsh bcsh.c syntax.tab.c -Wall \
40 --target=$targetPlatform \
41 --sysroot=$native/sysroot \
42 -march=$arch -mfloat-abi=softfp \ No newline at end of file