comparison Makefile @ 440:7a074e238db3 prerelease

Makefile: IDE runs in a loop
author Giulio Moro <giuliomoro@yahoo.it>
date Sat, 18 Jun 2016 21:23:15 +0100
parents 4c2588930b0a
children cdf77b9e66bf
comparison
equal deleted inserted replaced
439:e49ae69acbe8 440:7a074e238db3
55 SCREEN_NAME?=Bela 55 SCREEN_NAME?=Bela
56 BELA_IDE_STARTUP_SCRIPT?=/root/Bela_node.sh 56 BELA_IDE_STARTUP_SCRIPT?=/root/Bela_node.sh
57 BELA_IDE_HOME?=/root/Bela/IDE 57 BELA_IDE_HOME?=/root/Bela/IDE
58 # A bug in this version of screen forces us to use two screen names which beginning substrings do not match (Bela, Bela-IDE would cause problems) 58 # A bug in this version of screen forces us to use two screen names which beginning substrings do not match (Bela, Bela-IDE would cause problems)
59 BELA_IDE_SCREEN_NAME?=IDE-Bela 59 BELA_IDE_SCREEN_NAME?=IDE-Bela
60 BELA_IDE_RUN_COMMAND?=cd $(BELA_IDE_HOME) && screen -S $(BELA_IDE_SCREEN_NAME) -d -m /usr/local/bin/node index.js 60 BELA_IDE_RUN_COMMAND?=cd $(BELA_IDE_HOME) && screen -S $(BELA_IDE_SCREEN_NAME) -d -m bash -c "while true; do /usr/local/bin/node index.js; sleep 0.5; done"
61 BELA_IDE_STOP_COMMAND?=screen -X -S $(BELA_IDE_SCREEN_NAME) quit > /dev/null 61 BELA_IDE_STOP_COMMAND?=screen -X -S $(BELA_IDE_SCREEN_NAME) quit > /dev/null
62 62
63 ifneq (,$(filter $(QUIET_TARGETS),$(MAKECMDGOALS))) 63 ifneq (,$(filter $(QUIET_TARGETS),$(MAKECMDGOALS)))
64 QUIET=true 64 QUIET=true
65 endif 65 endif
289 idestop: ## Stops the on-board IDE 289 idestop: ## Stops the on-board IDE
290 @printf "Stopping currently running IDE..." 290 @printf "Stopping currently running IDE..."
291 @screen -X -S $(BELA_IDE_SCREEN_NAME) quit > /dev/null; exit 0; 291 @screen -X -S $(BELA_IDE_SCREEN_NAME) quit > /dev/null; exit 0;
292 @printf "done\n" 292 @printf "done\n"
293 293
294 BELA_IDE_STARTUP_COMMAND=printf "\#!/bin/sh\n\#\n\# This file is autogenerated by Bela. Do not edit!\n\necho Running the Bela IDE...\n$(BELA_IDE_RUN_COMMAND)\n" > $(BELA_IDE_STARTUP_SCRIPT) 294 BELA_IDE_STARTUP_COMMAND=printf '\#!/bin/sh\n\#\n\# This file is autogenerated by Bela. Do not edit!\n\necho Running the Bela IDE...\n$(BELA_IDE_RUN_COMMAND)\n' > $(BELA_IDE_STARTUP_SCRIPT)
295 295
296 idestartup: ## Enables the IDE at startup 296 idestartup: ## Enables the IDE at startup
297 @echo "Enabling the IDE at startup" 297 @echo "Enabling the IDE at startup"
298 @$(BELA_IDE_STARTUP_COMMAND) 298 @$(BELA_IDE_STARTUP_COMMAND)
299 @chmod +x $(BELA_IDE_STARTUP_SCRIPT) 299 @chmod +x $(BELA_IDE_STARTUP_SCRIPT)