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}" }