comparison Makefile @ 417:f4c41419f2e3 prerelease

Makefile added connect and ideconnect goals
author Giulio Moro <giuliomoro@yahoo.it>
date Thu, 16 Jun 2016 03:25:56 +0100
parents fc470c216464
children 9182fa7e802a
comparison
equal deleted inserted replaced
416:287bcb07de9a 417:f4c41419f2e3
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=coreclean distclean stop help idestart idestop idestartup idenostartup 11 NO_PROJECT_TARGETS=coreclean distclean stop help idestart idestop idestartup idenostartup connect ideconnect
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 # Type `$ make help` to get a description of the functionalities of this Makefile. 13 # Type `$ make help` to get a description of the functionalities of this Makefile.
14 help: ## Show this help 14 help: ## Show this help
15 @echo 'Usage: make [target] CL=[command line options] [PROJECT=[projectName] | EXAMPLE=[exampleName]]' 15 @echo 'Usage: make [target] CL=[command line options] [PROJECT=[projectName] | EXAMPLE=[exampleName]]'
16 @printf "\n$(NO_PROJECT_TARGETS_MESSAGE)\n\n" 16 @printf "\n$(NO_PROJECT_TARGETS_MESSAGE)\n\n"
200 200
201 # Other Targets: 201 # Other Targets:
202 # This rule compiles c and c++ source files without output or linking 202 # This rule compiles c and c++ source files without output or linking
203 SYNTAX: $(C_OBJS) $(CPP_OBJS) 203 SYNTAX: $(C_OBJS) $(CPP_OBJS)
204 204
205 projectclean:## Remove the project's build objects & binary 205 projectclean:## Remove the PROJECT's build objects & binary
206 -$(RM) $(PROJECT_DIR)/build/* $(OUTPUT_FILE) 206 -$(RM) $(PROJECT_DIR)/build/* $(OUTPUT_FILE)
207 -@echo ' ' 207 -@echo ' '
208 208
209 clean: ## Same as projectclean 209 clean: ## Same as projectclean
210 clean: projectclean 210 clean: projectclean
267 267
268 stop: ## Stops any Bela program that is currently running 268 stop: ## Stops any Bela program that is currently running
269 stop: 269 stop:
270 @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; 270 @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;
271 271
272 connect: ## Connects to the running Bela program (if any), can detach with ctrl-a ctrl-d.
273 @screen -r -S $(SCREEN_NAME)
274
272 idestart: ## Starts the on-board IDE 275 idestart: ## Starts the on-board IDE
273 idestart: idestop 276 idestart: idestop
274 @printf "Starting IDE..." 277 @printf "Starting IDE..."
275 @$(BELA_IDE_RUN_COMMAND) 278 @$(BELA_IDE_RUN_COMMAND)
276 @printf "done\n" 279 @printf "done\n"
288 @chmod +x $(BELA_IDE_STARTUP_SCRIPT) 291 @chmod +x $(BELA_IDE_STARTUP_SCRIPT)
289 292
290 idenostartup: ## Disables the IDE at startup 293 idenostartup: ## Disables the IDE at startup
291 @echo "Disabling the IDE at startup" 294 @echo "Disabling the IDE at startup"
292 @printf "#!/bin/sh\n#\n\n# This file is autogenerated by Bela. Do not edit!\n\n# The Bela IDE is disabled on startup.\n" > $(BELA_IDE_STARTUP_SCRIPT) 295 @printf "#!/bin/sh\n#\n\n# This file is autogenerated by Bela. Do not edit!\n\n# The Bela IDE is disabled on startup.\n" > $(BELA_IDE_STARTUP_SCRIPT)
293 .PHONY: all clean distclean help projectclean nostartup startup startuploop debug run runfg runscreen runscreenfg runscreenfifo stop idestart idestop idestartup idenostartup 296
297 ideconnect: ## Brings in the foreground the IDE that currently is running in a screen (if any), can detach with ctrl-a ctrl-d.
298 @screen -r -S $(BELA_IDE_SCREEN_NAME)
299
300 .PHONY: all clean distclean help projectclean nostartup startup startuploop debug run runfg runscreen runscreenfg runscreenfifo stop idestart idestop idestartup idenostartup ideconnect connect