• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2# Copyright (c) 2023 Huawei Device Co., Ltd.
3# UniProton is licensed under Mulan PSL v2.
4# You can use this software according to the terms and conditions of the Mulan PSL v2.
5# You may obtain a copy of Mulan PSL v2 at:
6#          http://license.coscl.org.cn/MulanPSL2
7# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
8# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
9# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
10# See the Mulan PSL v2 for more details.
11
12export TOOLCHAIN_PATH=/opt/buildtools/gcc-arm-none-eabi-10-2020-q4-major
13export APP=helloworld
14export TMP_DIR=$APP
15
16sh ./build_static.sh
17
18cmake -S .. -B $TMP_DIR -DAPP:STRING=$APP -DTOOLCHAIN_PATH:STRING=$TOOLCHAIN_PATH
19pushd $TMP_DIR
20make $APP
21popd
22cp $TMP_DIR/$APP $APP.elf
23$TOOLCHAIN_PATH/bin/arm-none-eabi-objcopy -O binary $TMP_DIR/$APP $APP.bin
24rm -rf $TMP_DIR
25