From 08bb9c5a1421548d3d63f9dc83a08689754ce051 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Wed, 7 Oct 2020 13:55:35 -0700 Subject: [PATCH] Our previous conditional building was really wrong. It never built if any .hex existed. This new version is still wrong, but less so. It at least checks the timestamp on the sketch Signed-off-by: Jesse Vincent --- bin/kaleidoscope-builder | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index f35007bf..8e0094ba 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -333,8 +333,12 @@ maybe_build () { build_version build_paths build_filenames - - if [ ! -e "${HEX_FILE_PATH}" ]; then + # If the hex file is older than the sketch file, or the hex file does not exist + # then rebuild. This is not as correct as letting make check our dependencies + # But it's less broken for most user use cases + # TODO(anyone): Make this suck less + SKETCH_FILE_PATH=$(absolute_filename "${SKETCH_DIR}/${SKETCH}.ino") + if [ "${HEX_FILE_PATH}" -ot "${SKETCH_FILE_PATH}" ]; then build "$@" fi