comparison Makefile @ 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
comparison
equal deleted inserted replaced
458:84841654c606 459:f48d28244fe2
6 # This Makefile is intended for use on the BeagleBone Black itself 6 # This Makefile is intended for use on the BeagleBone Black itself
7 # and not for cross-compiling 7 # and not for cross-compiling
8 8
9 .DEFAULT_GOAL := Bela 9 .DEFAULT_GOAL := Bela
10 10
11 NO_PROJECT_TARGETS=help coreclean distclean stop nostartup idestart idestop idestartup idenostartup connect ideconnect update checkupdate 11 NO_PROJECT_TARGETS=help coreclean distclean stop nostartup idestart idestop idestartup idenostartup connect ideconnect update checkupdate updateunsafe
12 NO_PROJECT_TARGETS_MESSAGE=PROJECT or EXAMPLE should be set for all targets except: $(NO_PROJECT_TARGETS) 12 NO_PROJECT_TARGETS_MESSAGE=PROJECT or EXAMPLE should be set for all targets except: $(NO_PROJECT_TARGETS)
13 # list of targets that automatically activate the QUIET=true flag 13 # list of targets that automatically activate the QUIET=true flag
14 QUIET_TARGETS=runide 14 QUIET_TARGETS=runide
15 15
16 # Type `$ make help` to get a description of the functionalities of this Makefile. 16 # Type `$ make help` to get a description of the functionalities of this Makefile.
331 @cd $(UPDATE_SOURCE_DIR) && FAIL=0 && for path in $(UPDATE_REQUIRED_PATHS); do `ls $$path >/dev/null 2>&1` || { FAIL=1; break; }; done;\ 331 @cd $(UPDATE_SOURCE_DIR) && FAIL=0 && for path in $(UPDATE_REQUIRED_PATHS); do `ls $$path >/dev/null 2>&1` || { FAIL=1; break; }; done;\
332 [ $$FAIL -eq 0 ] || { echo "$$path was not found in the zip archive. Maybe it is corrupted?"; exit 1; } 332 [ $$FAIL -eq 0 ] || { echo "$$path was not found in the zip archive. Maybe it is corrupted?"; exit 1; }
333 # Success. You can continue the install with "make update" 333 # Success. You can continue the install with "make update"
334 UPDATE_LOG?=~/update.log 334 UPDATE_LOG?=~/update.log
335 LOG=>> $(UPDATE_LOG) 2>&1 335 LOG=>> $(UPDATE_LOG) 2>&1
336 updateunsafe: ## Installs the update from $(UPDATES_DIR) in a more brick-friendly way
337 @echo > $(UPDATE_LOG)
338 # Re-perform the check, just in case ...
339 @cd $(UPDATE_SOURCE_DIR) && FAIL=0 && for path in $(UPDATE_REQUIRED_PATHS); do `ls $$path >/dev/null 2>&1` || { FAIL=1; break; }; done;\
340 [ $$FAIL -eq 0 ] || { echo "$$path was not found in the zip archive. Maybe it is corrupted?"; exit 1; }
341 @cd $(UPDATE_SOURCE_DIR)/scripts && BBB_ADDRESS=root@127.0.0.1 BBB_BELA_HOME=$(BELA_DIR) ./update_board -d -y --no-frills
342 @screen -S update-Bela -d -m bash -c "echo Restart the IDE $(LOG) &&\
343 $(MAKE) --no-print-directory idestart $(LOG) && echo Update succesful $(LOG);" $(LOG)
336 update: ## Installs the update from $(UPDATES_DIR) 344 update: ## Installs the update from $(UPDATES_DIR)
337 update: stop 345 update: stop
338 # Truncate the log file 346 # Truncate the log file
339 @echo > $(UPDATE_LOG) 347 @echo > $(UPDATE_LOG)
340 # Re-perform the check, just in case ... 348 # Re-perform the check, just in case ...
341 # Now actually check if some key-files and folders are there
342 @cd $(UPDATE_SOURCE_DIR) && FAIL=0 && for path in $(UPDATE_REQUIRED_PATHS); do `ls $$path >/dev/null 2>&1` || { FAIL=1; break; }; done;\ 349 @cd $(UPDATE_SOURCE_DIR) && FAIL=0 && for path in $(UPDATE_REQUIRED_PATHS); do `ls $$path >/dev/null 2>&1` || { FAIL=1; break; }; done;\
343 [ $$FAIL -eq 0 ] || { echo "$$path was not found in the zip archive. Maybe it is corrupted?"; exit 1; } 350 [ $$FAIL -eq 0 ] || { echo "$$path was not found in the zip archive. Maybe it is corrupted?"; exit 1; }
344 @[ -n $(UPDATE_BELA_PATCH) ] && mkdir -p $(UPDATE_BELA_PATCH) 351 @[ -n $(UPDATE_BELA_PATCH) ] && mkdir -p $(UPDATE_BELA_PATCH)
345 @#TODO: this would allow to trim trailing slashes in case we want to be safer: a="`pwd`/" ; target=${a%/} ; echo $target 352 @#TODO: this would allow to trim trailing slashes in case we want to be safer: a="`pwd`/" ; target=${a%/} ; echo $target
346 # Clean folder 353 # Clean folder
367 echo Restart the IDE $(LOG) &&\ 374 echo Restart the IDE $(LOG) &&\
368 make --no-print-directory -C $(BELA_DIR) idestart $(LOG) &&\ 375 make --no-print-directory -C $(BELA_DIR) idestart $(LOG) &&\
369 echo Update succesful $(LOG); \ 376 echo Update succesful $(LOG); \
370 ' $(LOG) 377 ' $(LOG)
371 378
372 .PHONY: all clean distclean help projectclean nostartup startup startuploop debug run runfg runscreen runscreenfg runscreenfifo stop idestart idestop idestartup idenostartup ideconnect connect update checkupdate 379 .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