# HG changeset patch # User Liam Donovan # Date 1465924126 -3600 # Node ID 47612dcb44de93f8d675911039b974ab4a65d5c6 # Parent fb5547fe6d99a38ca4489fe7b688dfadcc3ed05a add 'runide' target to Makefile diff -r fb5547fe6d99 -r 47612dcb44de Makefile --- 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"