# HG changeset patch # User Giulio Moro # Date 1466084058 -3600 # Node ID 9614e2f4b76ef29b9d178067a93eb58dfffe9997 # Parent 9182fa7e802a748e902f857d1f3fd48a5105bf21 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 diff -r 9182fa7e802a -r 9614e2f4b76e Makefile --- 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)