From b186478bffedbfc01ad13fe7dd5058957d0e971d Mon Sep 17 00:00:00 2001 From: Kenn Sebesta Date: Mon, 7 Mar 2022 09:12:59 -0500 Subject: [PATCH 1/2] [Makefile] `make all_fw_package_clean` target This uses the package_firmware.py script to package all the firmware, and then deletes the several GB of build cruft. NOT TESTED ON WINDOWS --- Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ce14ddf9..ce0b7159 100644 --- a/Makefile +++ b/Makefile @@ -217,8 +217,8 @@ $(foreach board, $(ALL_BOARD_NAMES), $(eval $(call FW_TEMPLATE,$(board),$(BUILD_ ############################## .PHONY: all_fw_package -all_fw_package: all_fw # Place all firmware files into `./package` directory +all_fw_package: all_fw all_fw_package_clean $(V1) python3 package_firmware.py # Find all the leftover object and lst files @@ -231,6 +231,15 @@ else $(V1) pwsh -noprofile -command {Remove-Item $(BUILD_CRUFT)} endif +.PHONY: all_fw_package_clean +all_fw_package_clean: + $(V0) @echo " CLEAN $(ROOT_DIR)/package/*" +ifneq ($(OSFAMILY), windows) + $(V1) [ ! -d "$(ROOT_DIR)/package/*" ] || $(RM) -r $(ROOT_DIR)/package/* +else + $(V1) pwsh -noprofile -command if (Test-Path $(ROOT_DIR)/package/*) {Remove-Item -Recurse $(ROOT_DIR)/package/*} +endif + ############################## # From 2f3bbcd00653e8f93671edabe119259aeb73aeba Mon Sep 17 00:00:00 2001 From: Kenn Sebesta Date: Mon, 7 Mar 2022 09:13:58 -0500 Subject: [PATCH 2/2] [Makefile] `make all_fw_package` target tweaks - Comments which are not tab-justified do not print to console - Add a teensy bit of console output --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ce0b7159..2b51e001 100644 --- a/Makefile +++ b/Makefile @@ -217,14 +217,16 @@ $(foreach board, $(ALL_BOARD_NAMES), $(eval $(call FW_TEMPLATE,$(board),$(BUILD_ ############################## .PHONY: all_fw_package - # Place all firmware files into `./package` directory all_fw_package: all_fw all_fw_package_clean + $(V0) @echo " PACKAGE $(ROOT_DIR)/package/*" + +# Place all firmware files into `./package` directory $(V1) python3 package_firmware.py - # Find all the leftover object and lst files +# Find all the leftover object and lst files $(eval BUILD_CRUFT := $(call rwildcard,$(ROOT_DIR)/build,*.lst *.o)) - # Delete the cruft files, so as not to unnecessarily consume GB of space +# Delete the cruft files, so as not to unnecessarily consume GB of space ifneq ($(OSFAMILY), windows) $(V1) $(RM) $(BUILD_CRUFT) else