changeset 424:9614e2f4b76e prerelease

Makefile now supports a QUIET flag which silences some of the outputs (currently only the one from STOP). QUIET is enabled by default for runide (or any of the QUIET_TARGETS). Added target for stop to runide
author Giulio Moro <giuliomoro@yahoo.it>
date Thu, 16 Jun 2016 14:34:18 +0100
parents 9182fa7e802a
children 99de323c13b3
files Makefile
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Thu Jun 16 14:05:17 2016 +0100
+++ b/Makefile	Thu Jun 16 14:34:18 2016 +0100
@@ -10,6 +10,9 @@
 
 NO_PROJECT_TARGETS=help coreclean distclean stop nostartup idestart idestop idestartup idenostartup connect ideconnect
 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
+
 # Type `$ make help` to get a description of the functionalities of this Makefile.
 help: ## Show this help
 	@echo 'Usage: make [target] CL=[command line options] [PROJECT=[projectName] | EXAMPLE=[exampleName]]'
@@ -57,6 +60,11 @@
 BELA_IDE_RUN_COMMAND?=cd $(BELA_IDE_HOME) && screen -S $(BELA_IDE_SCREEN_NAME) -d -m /usr/local/bin/node index.js
 BELA_IDE_STOP_COMMAND?=screen -X -S $(BELA_IDE_SCREEN_NAME) quit > /dev/null 
 
+ifneq (,$(filter $(QUIET_TARGETS),$(MAKECMDGOALS)))
+  QUIET=true
+endif
+QUIET?=false
+
 RM := rm -rf
 STATIC_LIBS := ./libprussdrv.a ./libNE10.a
 LIBS := -lrt -lnative -lxenomai -lsndfile
@@ -228,8 +236,8 @@
 run: stop Bela
 	@echo "Running $(RUN_COMMAND)"
 	@sync& cd $(PROJECT_DIR) && $(RUN_COMMAND)
-runide: ## Run PROJECT for IDE (foreground, without stop or build, suppressed output, no buffering)
-runide: Bela
+runide: ## Run PROJECT for IDE (foreground, no buffering)
+runide: stop Bela
 	@sync& cd $(PROJECT_DIR) && $(RUN_IDE_COMMAND)
 runscreen: ## Run PROJECT in the background (detached screen)
 runscreen: stop $(OUTPUT_FILE)
@@ -267,7 +275,7 @@
 
 stop: ## Stops any Bela program that is currently running
 stop:
-	@PID=`grep $(BELA_AUDIO_THREAD_NAME) /proc/xenomai/stat | cut -d " " -f 5 | sed s/\s//g`; if [ -z $$PID ]; then echo "No process to kill"; else echo "Killing old Bela process $$PID"; kill -2 $$PID; fi; screen -X -S $(SCREEN_NAME) quit > /dev/null; exit 0;
+	@PID=`grep $(BELA_AUDIO_THREAD_NAME) /proc/xenomai/stat | cut -d " " -f 5 | sed s/\s//g`; if [ -z $$PID ]; then [ $(QUIET) = true ] || echo "No process to kill"; else [  $(QUIET) = true  ] || echo "Killing old Bela process $$PID"; kill -2 $$PID; fi; screen -X -S $(SCREEN_NAME) quit > /dev/null; exit 0;
 
 connect: ## Connects to the running Bela program (if any), can detach with ctrl-a ctrl-d.
 	@screen -r -S $(SCREEN_NAME)