Mercurial > hg > beaglert
comparison Makefile @ 396:922535948800 prerelease
merge
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Tue, 14 Jun 2016 18:15:23 +0100 |
parents | b6b13f669174 d107cb121bfa |
children | 5848f5c8bc39 |
comparison
equal
deleted
inserted
replaced
395:a4e49a3d9948 | 396:922535948800 |
---|---|
44 endif | 44 endif |
45 | 45 |
46 OUTPUT_FILE?=$(PROJECT_DIR)/$(PROJECT) | 46 OUTPUT_FILE?=$(PROJECT_DIR)/$(PROJECT) |
47 COMMAND_LINE_OPTIONS?=$(CL) | 47 COMMAND_LINE_OPTIONS?=$(CL) |
48 RUN_COMMAND?=$(OUTPUT_FILE) $(COMMAND_LINE_OPTIONS) | 48 RUN_COMMAND?=$(OUTPUT_FILE) $(COMMAND_LINE_OPTIONS) |
49 RUN_IDE_COMMAND?=stdbuf -i0 -o0 -e0 $(RUN_COMMAND) | |
49 BELA_STARTUP_SCRIPT?=/root/BeagleRT_startup.sh | 50 BELA_STARTUP_SCRIPT?=/root/BeagleRT_startup.sh |
50 BELA_AUDIO_THREAD_NAME?=bela-audio | 51 BELA_AUDIO_THREAD_NAME?=bela-audio |
51 SCREEN_NAME?=Bela | 52 SCREEN_NAME?=Bela |
52 BELA_IDE_STARTUP_SCRIPT?=/root/BeagleRT_node.sh | 53 BELA_IDE_STARTUP_SCRIPT?=/root/BeagleRT_node.sh |
53 BELA_IDE_HOME?=/root/Bela/IDE | 54 BELA_IDE_HOME?=/root/Bela/IDE |
162 @echo ' ' | 163 @echo ' ' |
163 | 164 |
164 # Rule for user-supplied C++ files | 165 # Rule for user-supplied C++ files |
165 $(PROJECT_DIR)/build/%.o: $(PROJECT_DIR)/%.cpp | 166 $(PROJECT_DIR)/build/%.o: $(PROJECT_DIR)/%.cpp |
166 @echo 'Building $(notdir $<)...' | 167 @echo 'Building $(notdir $<)...' |
167 @echo 'Invoking: C++ Compiler $(CXX)' | 168 # @echo 'Invoking: C++ Compiler $(CXX)' |
168 @$(CXX) $(SYNTAX_FLAG) $(INCLUDES) $(CPP_FLAGS) -Wall -c -fmessage-length=0 -U_FORTIFY_SOURCE -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" | 169 @$(CXX) $(SYNTAX_FLAG) $(INCLUDES) $(CPP_FLAGS) -Wall -c -fmessage-length=0 -U_FORTIFY_SOURCE -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" |
169 @echo ' ...done' | 170 @echo ' ...done' |
170 @echo ' ' | 171 @echo ' ' |
171 | 172 |
172 # Rule for user-supplied C files | 173 # Rule for user-supplied C files |
190 # function, and conditionally call one of two recursive make targets depending on whether | 191 # function, and conditionally call one of two recursive make targets depending on whether |
191 # we want to link in the default main file or not. The kludge is the mess of a shell script | 192 # we want to link in the default main file or not. The kludge is the mess of a shell script |
192 # line below. Surely there's a better way to do this? | 193 # line below. Surely there's a better way to do this? |
193 $(OUTPUT_FILE): $(CORE_ASM_OBJS) $(CORE_OBJS) $(PROJECT_OBJS) $(STATIC_LIBS) $(DEFAULT_MAIN_OBJS) | 194 $(OUTPUT_FILE): $(CORE_ASM_OBJS) $(CORE_OBJS) $(PROJECT_OBJS) $(STATIC_LIBS) $(DEFAULT_MAIN_OBJS) |
194 $(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')) | 195 $(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')) |
195 @echo 'Invoking: C++ linker' | 196 @echo 'Linking...' |
196 @$(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) | 197 @$(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) |
197 @echo 'Finished building target: $@' | 198 @echo ' ...done' |
198 @sync | 199 |
199 # Other Targets: | 200 # Other Targets: |
200 # This rule compiles c and c++ source files without output or linking | 201 # This rule compiles c and c++ source files without output or linking |
201 SYNTAX: $(C_OBJS) $(CPP_OBJS) | 202 SYNTAX: $(C_OBJS) $(CPP_OBJS) |
202 | 203 |
203 projectclean:## Remove the project's build objects & binary | 204 projectclean:## Remove the project's build objects & binary |
223 | 224 |
224 runfg: run | 225 runfg: run |
225 run: ## Run PROJECT in the foreground | 226 run: ## Run PROJECT in the foreground |
226 run: stop Bela | 227 run: stop Bela |
227 @echo "Running $(RUN_COMMAND)" | 228 @echo "Running $(RUN_COMMAND)" |
228 @cd $(PROJECT_DIR) && $(RUN_COMMAND) | 229 @cd $(PROJECT_DIR) && sync& $(RUN_COMMAND) |
230 runide: ## Run PROJECT for IDE (foreground, without stop or build, suppressed output, no buffering) | |
231 runide: Bela | |
232 @cd $(PROJECT_DIR) && sync& $(RUN_IDE_COMMAND) | |
229 runscreen: ## Run PROJECT in the background (detached screen) | 233 runscreen: ## Run PROJECT in the background (detached screen) |
230 runscreen: stop $(OUTPUT_FILE) | 234 runscreen: stop $(OUTPUT_FILE) |
231 @echo "Running $(RUN_COMMAND) in a screen" | 235 @echo "Running $(RUN_COMMAND) in a screen" |
232 @cd $(PROJECT_DIR) && screen -S $(SCREEN_NAME) -d -m $(RUN_COMMAND) | 236 @cd $(PROJECT_DIR) && screen -S $(SCREEN_NAME) -d -m $(RUN_COMMAND) |
233 runscreenfg: ## Run PROJECT in a screen in the foreground (can detach with ctrl-a ctrl-d) | 237 runscreenfg: ## Run PROJECT in a screen in the foreground (can detach with ctrl-a ctrl-d) |