|
| 1 | +#!/bin/bash -e |
| 2 | +## |
| 3 | +## DAPLink Interface Firmware |
| 4 | +## Copyright (c) 2009-2016, ARM Limited, All Rights Reserved |
| 5 | +## SPDX-License-Identifier: Apache-2.0 |
| 6 | +## |
| 7 | +## Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 8 | +## not use this file except in compliance with the License. |
| 9 | +## You may obtain a copy of the License at |
| 10 | +## |
| 11 | +## http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | +## |
| 13 | +## Unless required by applicable law or agreed to in writing, software |
| 14 | +## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 15 | +## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | +## See the License for the specific language governing permissions and |
| 17 | +## limitations under the License. |
| 18 | +## |
| 19 | + |
| 20 | +project_tool=$1 |
| 21 | +env_folder=${2-env} |
| 22 | +requirements_file=${3-requirements.txt} |
| 23 | + |
| 24 | +if [[ "$project_tool" != "mbedcli" && "$project_tool" != "" ]]; then |
| 25 | + echo "Only mbedcli is supported in Linux build" |
| 26 | + exit 1 |
| 27 | +else |
| 28 | + echo "Compiling in Linux using mbedcli" |
| 29 | +fi |
| 30 | + |
| 31 | +if [[ "$ARM_PATH" == "" ]]; then |
| 32 | + echo "Need variable ARM_PATH to point to ARMCC directory" |
| 33 | + exit 1 |
| 34 | +else |
| 35 | + echo "Using ARMCC in $ARM_PATH" |
| 36 | +fi |
| 37 | + |
| 38 | +echo $env_folder |
| 39 | +echo $requirements_file |
| 40 | + |
| 41 | +if [ ! -d $env_folder ];then |
| 42 | + echo "Generating virtualenv folder $env_folder" |
| 43 | + virtualenv $env_folder |
| 44 | +else |
| 45 | + echo "Using $env_folder" |
| 46 | +fi |
| 47 | + |
| 48 | +source $env_folder/bin/activate |
| 49 | +pip install -r $requirements_file |
| 50 | +mbed deploy |
| 51 | + |
| 52 | +python tools/mbedcli_compile.py --clean --release |
| 53 | +if [ $? -ne 0 ]; then |
| 54 | + exit $? |
| 55 | +fi |
| 56 | +python tools/copy_release_files.py --project-tool mbedcli |
| 57 | +exit $? |
0 commit comments