From 6ada3ab98d4f88f962e6d1abaaeccd2c14f3e59d Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sun, 15 Nov 2020 19:15:28 -0800 Subject: [PATCH] lift 'make clean' to the makefile --- bin/kaleidoscope-builder | 11 ----------- etc/sketch-arduino-cli.mk | 3 +++ 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index e09bb6f2..5643497e 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -87,10 +87,6 @@ _set_build_paths() { -_absolute_filename() { - echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")" -} - _find_sketch() { if [ -z "${SKETCH_FILE_PATH}" ] || [ ! -f "${SKETCH_FILE_PATH}" ]; then # Didn't find a sketch @@ -185,13 +181,6 @@ cmd_disassemble() { "${AVR_OBJDUMP}" -C -d "${ELF_FILE_PATH}" } -cmd_clean() { - _set_up_environment - if [ -d "$OUTPUT_PATH" ]; then - rm -rf -- "${OUTPUT_PATH}" - fi -} - _set_up_environment() { _find_sketch _set_build_paths diff --git a/etc/sketch-arduino-cli.mk b/etc/sketch-arduino-cli.mk index 26cbab0f..201ff4c4 100644 --- a/etc/sketch-arduino-cli.mk +++ b/etc/sketch-arduino-cli.mk @@ -111,6 +111,9 @@ size-map: compile flash: compile +clean: + rm -rf -- "${OUTPUT_PATH}/*" + %: $(KALEIDOSCOPE_BIN_DIR)/kaleidoscope-builder $@