• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2# Copyright (c) 2021 Huawei Device Co., Ltd.
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14set -e
15DIR=$(dirname $(realpath ${BASH_SOURCE[0]}))
16TOP=$(realpath $DIR/../../../)
17echo $DIR
18cd $DIR
19
20if [ -z "$1" ]; then
21    echo "no product name"
22    exit -1
23fi
24
25BUILD_OUT=$TOP/out/$1
26HOST_OUT=$TOP/out/host/developtools/hiperf
27BUILD_PATH=/developtools/hiperf
28if [ -d "$HOST_OUT" ]; then
29    echo "remove $HOST_OUT"
30    rm -rf $HOST_OUT
31fi
32mkdir -p $HOST_OUT
33
34# script
35cp -vf *.py $HOST_OUT
36cp -vf *.html $HOST_OUT
37
38# bin
39HOST_LINUX_PATH=$BUILD_OUT/clang_x64$BUILD_PATH
40HOST_LINUX_OUT_PATH=$HOST_OUT/bin/linux/x86_64
41mkdir -p $HOST_LINUX_OUT_PATH
42
43HOST_WINDOWS_PATH=$BUILD_OUT/mingw_x86_64$BUILD_PATH
44HOST_WINDOWS_OUT_PATH=$HOST_OUT/bin/windows/x86_64
45mkdir -p $HOST_WINDOWS_OUT_PATH
46
47OHOS_ARM_PATH=$BUILD_OUT$BUILD_PATH
48OHOS_ARM_OUT_PATH=$HOST_OUT/bin/ohos/arm
49mkdir -p $OHOS_ARM_OUT_PATH
50
51cp -vf $HOST_LINUX_PATH/hiperf_host  $HOST_LINUX_OUT_PATH
52cp -vf $HOST_LINUX_PATH/*.so  $HOST_LINUX_OUT_PATH
53
54cp -vf $HOST_WINDOWS_PATH/hiperf_host.exe  $HOST_WINDOWS_OUT_PATH
55cp -vf $HOST_WINDOWS_PATH/*.dll  $HOST_WINDOWS_OUT_PATH
56
57cp -vf $OHOS_ARM_PATH/hiperf $OHOS_ARM_OUT_PATH
58
59cd $HOST_OUT/../
60rm -f hiperf.tar.gz
61tar czvf hiperf.tar.gz hiperf
62cd -
63