remove our old custom 'size' target, since arduino pritns it for us

tmp/arduino-cli-pre-rebase
Jesse Vincent 4 years ago
parent 58337769a0
commit 7874548a93
No known key found for this signature in database
GPG Key ID: CC228463465E40BC

@ -212,35 +212,6 @@ enable_ccache() {
fi fi
} }
firmware_size() {
if [ "${ARCH}" = "virtual" ]; then
echo "[Size not computed for virtual build]"
return
fi
: "${MAX_PROG_SIZE:=$(get_arduino_pref 'upload.maximum_size')}"
## This is a terrible hack, please don't hurt me. - algernon
set +e
raw_output=$("$@" 2>/dev/null)
rc=$?
set -e
if [ $rc -eq 0 ]; then
output="$(echo "${raw_output}" | grep "\\(Program\\|Data\\):" | sed -e 's,^, - ,' && echo)"
PROGSIZE="$(echo "${output}" | grep "Program:" | cut -d: -f2 | awk '{print $1}')"
PERCENT="$(echo "${PROGSIZE}" "${MAX_PROG_SIZE}" | awk "{ printf \"%02.01f\", \$1 / \$2 * 100 }")"
# we want the sed there, doing with shell builtins would be worse.
# shellcheck disable=SC2001 disable=SC1117
echo "${output}" | sed -e "s/\(Program:.*\)(\([0-9\.]*%\) Full)/\1(${PERCENT}% Full)/"
else
echo "Unable to determine image size."
fi
}
find_sketch() { find_sketch() {
SKETCH_DIR="${SKETCH:-$(absolute_filename "$(pwd)")}" SKETCH_DIR="${SKETCH:-$(absolute_filename "$(pwd)")}"
@ -338,7 +309,6 @@ hex_with_bootloader() {
build() { build() {
compile "$@" compile "$@"
size "$@"
} }
prepare_ccache() { prepare_ccache() {
@ -381,7 +351,6 @@ set_executable_paths() {
# Allow the compiler prefix to be empty for virtual builds # Allow the compiler prefix to be empty for virtual builds
COMPILER_PREFIX="${COMPILER_PREFIX-avr-}" COMPILER_PREFIX="${COMPILER_PREFIX-avr-}"
: "${AVR_SIZE:=${COMPILER_PATH}/${COMPILER_PREFIX}size}"
: "${AVR_OBJDUMP:=${COMPILER_PATH}/${COMPILER_PREFIX}objdump}" : "${AVR_OBJDUMP:=${COMPILER_PATH}/${COMPILER_PREFIX}objdump}"
: "${AVR_OBJCOPY:=${COMPILER_PATH}/${COMPILER_PREFIX}objcopy}" : "${AVR_OBJCOPY:=${COMPILER_PATH}/${COMPILER_PREFIX}objcopy}"
: "${AVR_NM:=${COMPILER_PATH}/${COMPILER_PREFIX}nm}" : "${AVR_NM:=${COMPILER_PATH}/${COMPILER_PREFIX}nm}"
@ -502,16 +471,6 @@ build_all() {
done done
} }
size() {
compile
: "${AVR_SIZE_FLAGS:=-C --mcu=$(get_arduino_pref 'build.mcu')}"
echo "- Size: ${ELF_FILE_PATH}"
# shellcheck disable=SC2086
firmware_size "${AVR_SIZE}" ${AVR_SIZE_FLAGS} "${ELF_FILE_PATH}"
echo
}
size_map() { size_map() {
compile compile
@ -599,12 +558,6 @@ usage() {
compile compile
Compiles the sketch. Compiles the sketch.
size
Reports the size of the compiled sketch.
build
Runs compile and report-size.
clean clean
Cleans up the output directory. Cleans up the output directory.

Loading…
Cancel
Save