Mercurial > hg > beaglert
changeset 446:566bb80c2d14 prerelease
Makefile has option for RUN_FROM=/full/path
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Sun, 19 Jun 2016 12:43:43 +0100 |
parents | 2b09be3fb0f2 |
children | 86591d203c78 |
files | Makefile |
diffstat | 1 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile Sun Jun 19 03:28:53 2016 +0100 +++ b/Makefile Sun Jun 19 12:43:43 2016 +0100 @@ -48,6 +48,7 @@ OUTPUT_FILE?=$(PROJECT_DIR)/$(PROJECT) COMMAND_LINE_OPTIONS?=$(CL) +RUN_FROM?=$(PROJECT_DIR) RUN_COMMAND?=$(OUTPUT_FILE) $(COMMAND_LINE_OPTIONS) RUN_IDE_COMMAND?=stdbuf -i0 -o0 -e0 $(RUN_COMMAND) BELA_STARTUP_SCRIPT?=/root/Bela_startup.sh @@ -235,26 +236,25 @@ run: ## Run PROJECT in the foreground run: stop Bela @echo "Running $(RUN_COMMAND)" - @sync& cd $(PROJECT_DIR) && $(RUN_COMMAND) + @sync& cd $(RUN_FROM) && $(RUN_COMMAND) runide: ## Run PROJECT for IDE (foreground, no buffering) runide: stop Bela - @sync& cd $(PROJECT_DIR) && $(RUN_IDE_COMMAND) + @sync& cd $(RUN_FROM) && $(RUN_IDE_COMMAND) runscreen: ## Run PROJECT in the background (detached screen) runscreen: stop $(OUTPUT_FILE) @echo "Running $(RUN_COMMAND) in a screen" - @cd $(PROJECT_DIR) && screen -S $(SCREEN_NAME) -d -m $(RUN_COMMAND) + @cd $(RUN_FROM) && screen -S $(SCREEN_NAME) -d -m $(RUN_COMMAND) runscreenfg: ## Run PROJECT in a screen in the foreground (can detach with ctrl-a ctrl-d) runscreenfg: stop $(OUTPUT_FILE) @echo "Running $(RUN_COMMAND) in a screen" - @cd $(PROJECT_DIR) && screen -S $(SCREEN_NAME) -m $(RUN_COMMAND) + @cd $(RUN_FROM) && screen -S $(SCREEN_NAME) -m $(RUN_COMMAND) FIFO_NAME=/tmp/belafifo runscreenfifo: ## Same as runscreen, but stdout and stderr are piped to the foreground through a fifo runscreenfifo: stop $(OUTPUT_FILE) @echo "Running $(RUN_COMMAND), piping output to $(FIFO_NAME)" @rm -rf $(FIFO_NAME) @mkfifo $(FIFO_NAME) - @cd $(PROJECT_DIR) - @screen -S $(SCREEN_NAME) -d -m stdbuf -e 0 -i 0 -o 0 bash -c "$(RUN_COMMAND) &> $(FIFO_NAME)" + @cd $(RUN_FROM) && screen -S $(SCREEN_NAME) -d -m stdbuf -e 0 -i 0 -o 0 bash -c "$(RUN_COMMAND) &> $(FIFO_NAME)" @cat /tmp/belafifo STARTUP_COMMAND=printf "\#!/bin/sh\n\#\n\# This file is autogenerated by Bela. Do not edit!\n\necho Running Bela...\nscreen -S $(SCREEN_NAME) -d -m %s $(RUN_COMMAND) %s\n"