changeset 387:47612dcb44de prerelease

add 'runide' target to Makefile
author Liam Donovan <l.b.donovan@qmul.ac.uk>
date Tue, 14 Jun 2016 18:08:46 +0100
parents fb5547fe6d99
children fe2f8e00096b
files Makefile
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Tue Jun 14 11:30:31 2016 +0100
+++ b/Makefile	Tue Jun 14 18:08:46 2016 +0100
@@ -43,6 +43,7 @@
 OUTPUT_FILE?=$(PROJECT_DIR)/$(PROJECT)
 COMMAND_LINE_OPTIONS?=$(CL)
 RUN_COMMAND?=$(OUTPUT_FILE) $(COMMAND_LINE_OPTIONS)
+RUN_IDE_COMMAND?=stdbuf -i0 -o0 -e0 $(OUTPUT_FILE) $(COMMAND_LINE_OPTIONS)
 BELA_STARTUP_SCRIPT?=/root/BeagleRT_startup.sh
 BELA_AUDIO_THREAD_NAME?=bela-audio 
 SCREEN_NAME?=Bela
@@ -75,7 +76,6 @@
   endif
 endif
 
-$(warning $(COMPILER))
 ifeq ($(COMPILER), clang)
   CC=clang
   CXX=clang++
@@ -186,10 +186,10 @@
 # line below. Surely there's a better way to do this?
 $(OUTPUT_FILE): $(CORE_ASM_OBJS) $(CORE_OBJS) $(PROJECT_OBJS) $(STATIC_LIBS) $(DEFAULT_MAIN_OBJS)
 	$(eval DEFAULT_MAIN_CONDITIONAL := $(shell bash -c 'if [ `nm $(PROJECT_OBJS) | grep -w T | grep -w main | wc -l` == '0' ]; then echo "$(DEFAULT_MAIN_OBJS)"; else echo ""; fi'))
-	@echo 'Invoking: C++ linker'
+	@echo 'Linking...'
 	@$(CXX) $(SYNTAX_FLAG) -L/usr/xenomai/lib -L/usr/arm-linux-gnueabihf/lib -L/usr/arm-linux-gnueabihf/lib/xenomai -L/usr/lib/arm-linux-gnueabihf -pthread -Wpointer-arith -o "$(PROJECT_DIR)/$(PROJECT)" $(CORE_ASM_OBJS) $(CORE_OBJS) $(DEFAULT_MAIN_CONDITIONAL) $(ASM_OBJS) $(C_OBJS) $(CPP_OBJS) $(STATIC_LIBS) $(LIBS)
-	@echo 'Finished building target: $@'
-	@sync
+	@echo ' ...done'
+	
 # Other Targets:
 # This rule compiles c and c++ source files without output or linking
 SYNTAX: $(C_OBJS) $(CPP_OBJS)
@@ -206,7 +206,10 @@
 run: ## Run PROJECT in the foreground
 run: stop Bela
 	@echo "Running $(RUN_COMMAND)"
-	@cd $(PROJECT_DIR) && $(RUN_COMMAND)
+	@cd $(PROJECT_DIR) && sync& $(RUN_COMMAND)
+runide: ## Run PROJECT for IDE (foreground, without stop or build, suppressed output, no buffering)
+runide: Bela
+	@cd $(PROJECT_DIR) && sync& $(RUN_IDE_COMMAND)
 runscreen: ## Run PROJECT in the background (detached screen)
 runscreen: stop $(OUTPUT_FILE)
 	@echo "Running $(RUN_COMMAND) in a screen"