Mercurial > hg > beaglert
changeset 459:f48d28244fe2 prerelease
Added updateunsafe target to Makefile: faster, less resistant to sudden shutdowns
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Mon, 20 Jun 2016 03:17:05 +0100 |
parents | 84841654c606 |
children | f96238bdbb18 |
files | Makefile |
diffstat | 1 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile Mon Jun 20 02:48:31 2016 +0100 +++ b/Makefile Mon Jun 20 03:17:05 2016 +0100 @@ -8,7 +8,7 @@ .DEFAULT_GOAL := Bela -NO_PROJECT_TARGETS=help coreclean distclean stop nostartup idestart idestop idestartup idenostartup connect ideconnect update checkupdate +NO_PROJECT_TARGETS=help coreclean distclean stop nostartup idestart idestop idestartup idenostartup connect ideconnect update checkupdate updateunsafe NO_PROJECT_TARGETS_MESSAGE=PROJECT or EXAMPLE should be set for all targets except: $(NO_PROJECT_TARGETS) # list of targets that automatically activate the QUIET=true flag QUIET_TARGETS=runide @@ -333,12 +333,19 @@ # Success. You can continue the install with "make update" UPDATE_LOG?=~/update.log LOG=>> $(UPDATE_LOG) 2>&1 +updateunsafe: ## Installs the update from $(UPDATES_DIR) in a more brick-friendly way + @echo > $(UPDATE_LOG) + # Re-perform the check, just in case ... + @cd $(UPDATE_SOURCE_DIR) && FAIL=0 && for path in $(UPDATE_REQUIRED_PATHS); do `ls $$path >/dev/null 2>&1` || { FAIL=1; break; }; done;\ + [ $$FAIL -eq 0 ] || { echo "$$path was not found in the zip archive. Maybe it is corrupted?"; exit 1; } + @cd $(UPDATE_SOURCE_DIR)/scripts && BBB_ADDRESS=root@127.0.0.1 BBB_BELA_HOME=$(BELA_DIR) ./update_board -d -y --no-frills + @screen -S update-Bela -d -m bash -c "echo Restart the IDE $(LOG) &&\ + $(MAKE) --no-print-directory idestart $(LOG) && echo Update succesful $(LOG);" $(LOG) update: ## Installs the update from $(UPDATES_DIR) update: stop # Truncate the log file @echo > $(UPDATE_LOG) # Re-perform the check, just in case ... - # Now actually check if some key-files and folders are there @cd $(UPDATE_SOURCE_DIR) && FAIL=0 && for path in $(UPDATE_REQUIRED_PATHS); do `ls $$path >/dev/null 2>&1` || { FAIL=1; break; }; done;\ [ $$FAIL -eq 0 ] || { echo "$$path was not found in the zip archive. Maybe it is corrupted?"; exit 1; } @[ -n $(UPDATE_BELA_PATCH) ] && mkdir -p $(UPDATE_BELA_PATCH) @@ -369,4 +376,4 @@ echo Update succesful $(LOG); \ ' $(LOG) -.PHONY: all clean distclean help projectclean nostartup startup startuploop debug run runfg runscreen runscreenfg runscreenfifo stop idestart idestop idestartup idenostartup ideconnect connect update checkupdate +.PHONY: all clean distclean help projectclean nostartup startup startuploop debug run runfg runscreen runscreenfg runscreenfifo stop idestart idestop idestartup idenostartup ideconnect connect update checkupdate updateunsafe