From f371692a103a28abea70dd4cdf3bda72baa4fbe2 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Tue, 24 Jan 2017 12:27:27 +0100 Subject: [PATCH] tools/keyboardio-builder: Dependency handling Commands that depend on others, will now automatically call them if need be. Signed-off-by: Gergely Nagy --- tools/keyboardio-builder | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tools/keyboardio-builder b/tools/keyboardio-builder index cabe6789..59a79573 100755 --- a/tools/keyboardio-builder +++ b/tools/keyboardio-builder @@ -55,6 +55,10 @@ find_sketch () { flash () { . ${ROOT}/tools/settings.sh + if [ ! -e "{HEX_FILE_PATH}" ]; then + compile + fi + echo "Press ENTER when ready..." read a @@ -66,6 +70,10 @@ flash () { program () { . ${ROOT}/tools/settings.sh + if [ ! -e "{HEX_FILE_PATH}" ]; then + compile + fi + echo "Press ENTER when ready..." read a @@ -80,6 +88,10 @@ program () { hex_with_bootloader () { . ${ROOT}/tools/settings.sh + if [ ! -e "{HEX_FILE_PATH}" ]; then + compile + fi + cat ${HEX_FILE_PATH} | awk '/^:00000001FF/ == 0' > ${HEX_FILE_WITH_BOOTLOADER_PATH} echo "Using ${BOOTLOADER_PATH}" ${MD5} ${BOOTLOADER_PATH} @@ -164,6 +176,10 @@ build_all () { report_size () { . ${ROOT}/tools/settings.sh + if [ ! -e "{HEX_FILE_PATH}" ]; then + compile + fi + echo "- Size: firmware/${LIBRARY}/${OUTPUT_FILE_PREFIX}.elf" firmware_size "${AVR_SIZE}" -C --mcu="${MCU}" "${ELF_FILE_PATH}" echo @@ -172,12 +188,20 @@ report_size () { size_map () { . ${ROOT}/tools/settings.sh + if [ ! -e "{HEX_FILE_PATH}" ]; then + compile + fi + "${AVR_NM}" --size-sort -C -r -l "${ELF_FILE_PATH}" } decompile () { . ${ROOT}/tools/settings.sh + if [ ! -e "{HEX_FILE_PATH}" ]; then + compile + fi + "${AVR_OBJDUMP}" -d "${ELF_FILE_PATH}" }