Ram Gandikota
/
IOTMetronome
FRDM K64F Metronome
mbed-client/get_sizes.sh@0:dbad57390bd1, 2017-05-14 (annotated)
- Committer:
- ram54288
- Date:
- Sun May 14 18:37:05 2017 +0000
- Revision:
- 0:dbad57390bd1
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ram54288 | 0:dbad57390bd1 | 1 | #!/bin/bash |
ram54288 | 0:dbad57390bd1 | 2 | # Copyright (c) 2016 ARM Limited. All rights reserved. |
ram54288 | 0:dbad57390bd1 | 3 | # SPDX-License-Identifier: Apache-2.0 |
ram54288 | 0:dbad57390bd1 | 4 | # Licensed under the Apache License, Version 2.0 (the License); you may |
ram54288 | 0:dbad57390bd1 | 5 | # not use this file except in compliance with the License. |
ram54288 | 0:dbad57390bd1 | 6 | # You may obtain a copy of the License at |
ram54288 | 0:dbad57390bd1 | 7 | # |
ram54288 | 0:dbad57390bd1 | 8 | # * http://www.apache.org/licenses/LICENSE-2.0 |
ram54288 | 0:dbad57390bd1 | 9 | # |
ram54288 | 0:dbad57390bd1 | 10 | # Unless required by applicable law or agreed to in writing, software |
ram54288 | 0:dbad57390bd1 | 11 | # distributed under the License is distributed on an AS IS BASIS, WITHOUT |
ram54288 | 0:dbad57390bd1 | 12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
ram54288 | 0:dbad57390bd1 | 13 | # See the License for the specific language governing permissions and |
ram54288 | 0:dbad57390bd1 | 14 | # limitations under the License. |
ram54288 | 0:dbad57390bd1 | 15 | |
ram54288 | 0:dbad57390bd1 | 16 | echo |
ram54288 | 0:dbad57390bd1 | 17 | echo "Build mbed Client API for executable size collection" |
ram54288 | 0:dbad57390bd1 | 18 | echo |
ram54288 | 0:dbad57390bd1 | 19 | |
ram54288 | 0:dbad57390bd1 | 20 | BUILD_TARGET="frdm-k64f-armcc" |
ram54288 | 0:dbad57390bd1 | 21 | |
ram54288 | 0:dbad57390bd1 | 22 | yt target $BUILD_TARGET |
ram54288 | 0:dbad57390bd1 | 23 | yt build |
ram54288 | 0:dbad57390bd1 | 24 | |
ram54288 | 0:dbad57390bd1 | 25 | SIZE_CMD="size --totals" |
ram54288 | 0:dbad57390bd1 | 26 | |
ram54288 | 0:dbad57390bd1 | 27 | OUTPUT_PATH="results/" |
ram54288 | 0:dbad57390bd1 | 28 | OUTPUT_FILE_POSTFIX="_${BUILD_TARGET}_size.txt" |
ram54288 | 0:dbad57390bd1 | 29 | |
ram54288 | 0:dbad57390bd1 | 30 | MAIN_MODULE_NAME="mbed-client" |
ram54288 | 0:dbad57390bd1 | 31 | |
ram54288 | 0:dbad57390bd1 | 32 | # yotta dependencies |
ram54288 | 0:dbad57390bd1 | 33 | YOTTA_DEPS=( |
ram54288 | 0:dbad57390bd1 | 34 | 'cmsis-core' |
ram54288 | 0:dbad57390bd1 | 35 | 'cmsis-core-k64f' |
ram54288 | 0:dbad57390bd1 | 36 | 'core-util' |
ram54288 | 0:dbad57390bd1 | 37 | 'dlmalloc' |
ram54288 | 0:dbad57390bd1 | 38 | 'greentea-client' |
ram54288 | 0:dbad57390bd1 | 39 | 'mbed-client-c' |
ram54288 | 0:dbad57390bd1 | 40 | 'mbed-client-mbed-os' |
ram54288 | 0:dbad57390bd1 | 41 | 'mbed-client-mbedtls' |
ram54288 | 0:dbad57390bd1 | 42 | 'mbed-drivers' |
ram54288 | 0:dbad57390bd1 | 43 | 'mbed-hal' |
ram54288 | 0:dbad57390bd1 | 44 | 'mbed-hal-frdm-k64f' |
ram54288 | 0:dbad57390bd1 | 45 | 'mbed-hal-k64f' |
ram54288 | 0:dbad57390bd1 | 46 | 'mbed-hal-ksdk-mcu' |
ram54288 | 0:dbad57390bd1 | 47 | 'mbedtls' |
ram54288 | 0:dbad57390bd1 | 48 | 'mbed-trace' |
ram54288 | 0:dbad57390bd1 | 49 | 'minar' |
ram54288 | 0:dbad57390bd1 | 50 | 'minar-platform-mbed' |
ram54288 | 0:dbad57390bd1 | 51 | 'nanostack-libservice' |
ram54288 | 0:dbad57390bd1 | 52 | 'sal' |
ram54288 | 0:dbad57390bd1 | 53 | 'sal-driver-lwip-k64f-eth' |
ram54288 | 0:dbad57390bd1 | 54 | 'sal-iface-eth' |
ram54288 | 0:dbad57390bd1 | 55 | 'sal-stack-lwip' |
ram54288 | 0:dbad57390bd1 | 56 | 'sockets' |
ram54288 | 0:dbad57390bd1 | 57 | 'ualloc' |
ram54288 | 0:dbad57390bd1 | 58 | 'uvisor-lib' |
ram54288 | 0:dbad57390bd1 | 59 | ) |
ram54288 | 0:dbad57390bd1 | 60 | |
ram54288 | 0:dbad57390bd1 | 61 | |
ram54288 | 0:dbad57390bd1 | 62 | # yotta dummy dependencies, which have different naming |
ram54288 | 0:dbad57390bd1 | 63 | YOTTA_DUMMY_DEPS=( |
ram54288 | 0:dbad57390bd1 | 64 | 'cmsis-core-freescale' |
ram54288 | 0:dbad57390bd1 | 65 | 'compiler-polyfill' |
ram54288 | 0:dbad57390bd1 | 66 | 'mbed-hal-freescale' |
ram54288 | 0:dbad57390bd1 | 67 | 'minar-platform' |
ram54288 | 0:dbad57390bd1 | 68 | ) |
ram54288 | 0:dbad57390bd1 | 69 | |
ram54288 | 0:dbad57390bd1 | 70 | |
ram54288 | 0:dbad57390bd1 | 71 | echo "Writing object file size informations to ${OUTPUT_PATH}" |
ram54288 | 0:dbad57390bd1 | 72 | |
ram54288 | 0:dbad57390bd1 | 73 | # the "main" module is in build/<target>/source/<module>.ar |
ram54288 | 0:dbad57390bd1 | 74 | ${SIZE_CMD} ./build/${BUILD_TARGET}/source/${MAIN_MODULE_NAME}.ar >${OUTPUT_PATH}${MAIN_MODULE_NAME}${OUTPUT_FILE_POSTFIX} |
ram54288 | 0:dbad57390bd1 | 75 | |
ram54288 | 0:dbad57390bd1 | 76 | # these are the direct deps, found as build/<target>/ym/<module>/source/<module>.ar |
ram54288 | 0:dbad57390bd1 | 77 | for MODULE in "${YOTTA_DEPS[@]}" |
ram54288 | 0:dbad57390bd1 | 78 | do |
ram54288 | 0:dbad57390bd1 | 79 | ${SIZE_CMD} ./build/${BUILD_TARGET}/ym/${MODULE}/source/${MODULE}.ar >${OUTPUT_PATH}${MODULE}${OUTPUT_FILE_POSTFIX} |
ram54288 | 0:dbad57390bd1 | 80 | done |
ram54288 | 0:dbad57390bd1 | 81 | |
ram54288 | 0:dbad57390bd1 | 82 | # dummy libs, which are named with different logic |
ram54288 | 0:dbad57390bd1 | 83 | for MODULE in "${YOTTA_DUMMY_DEPS[@]}" |
ram54288 | 0:dbad57390bd1 | 84 | do |
ram54288 | 0:dbad57390bd1 | 85 | # on paths the "-" char needs to be converted to "_" |
ram54288 | 0:dbad57390bd1 | 86 | MODULE_PATH=${MODULE//-/_} |
ram54288 | 0:dbad57390bd1 | 87 | ${SIZE_CMD} ./build/${BUILD_TARGET}/ym/${MODULE}/yotta_dummy_lib_${MODULE_PATH}/${MODULE}.ar >${OUTPUT_PATH}${MODULE}${OUTPUT_FILE_POSTFIX} |
ram54288 | 0:dbad57390bd1 | 88 | done |