Mercurial > hg > beaglert
comparison scripts/build_project.sh @ 377:a430a16d2c02 prerelease
Updated scripts so that the Bela folder on the bbb is ~/Bela. Note: BeagleRT_startup.sh is still the same (because the reference to it needs to be changed in /etc/init.d/ ....
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Sat, 11 Jun 2016 01:54:43 +0100 |
parents | 137a87b745d2 |
children | 99de323c13b3 |
comparison
equal
deleted
inserted
replaced
376:9d2ed561aac5 | 377:a430a16d2c02 |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 # This script compiles a BeagleRT project on the BeagleBone Black and | 3 # This script compiles a Bela project on the BeagleBone Black and |
4 # optionally runs it. Pass a directory path in the first argument. | 4 # optionally runs it. Pass a directory path in the first argument. |
5 # The source files in this directory are copied to the board and compiled. | 5 # The source files in this directory are copied to the board and compiled. |
6 | 6 |
7 # set defaults unless variables are already set | 7 # set defaults unless variables are already set |
8 [ -z "$BBB_ADDRESS" ] && BBB_ADDRESS="root@192.168.7.2" | 8 [ -z "$BBB_ADDRESS" ] && BBB_ADDRESS="root@192.168.7.2" |
9 [ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/BeagleRT/" | 9 [ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/Bela/" |
10 [ -z "$BBB_SCREEN_NAME" ] && BBB_SCREEN_NAME="BeagleRT" | 10 [ -z "$BBB_SCREEN_NAME" ] && BBB_SCREEN_NAME="Bela" |
11 [ -z "$RUN_PROJECT" ] && RUN_PROJECT=1 | 11 [ -z "$RUN_PROJECT" ] && RUN_PROJECT=1 |
12 [ -z "$COMMAND_ARGS" ] && COMMAND_ARGS= | 12 [ -z "$COMMAND_ARGS" ] && COMMAND_ARGS= |
13 [ -z "$RUN_IN_FOREGROUND" ] && RUN_IN_FOREGROUND=1 | 13 [ -z "$RUN_IN_FOREGROUND" ] && RUN_IN_FOREGROUND=1 |
14 [ -z "$RUN_WITHOUT_SCREEN" ] && RUN_WITHOUT_SCREEN=0 | 14 [ -z "$RUN_WITHOUT_SCREEN" ] && RUN_WITHOUT_SCREEN=0 |
15 [ -z "$BBB_PROJECT_HOME" ] && BBB_PROJECT_HOME="${BBB_BELA_HOME}/projects/" | 15 [ -z "$BBB_PROJECT_HOME" ] && BBB_PROJECT_HOME="${BBB_BELA_HOME}/projects/" |
20 { | 20 { |
21 THIS_SCRIPT=`basename "$0"` | 21 THIS_SCRIPT=`basename "$0"` |
22 echo "Usage: $THIS_SCRIPT [-c command-line-args] [-nbfF] <directory-with-source-files>" | 22 echo "Usage: $THIS_SCRIPT [-c command-line-args] [-nbfF] <directory-with-source-files>" |
23 echo " | 23 echo " |
24 This script copies a directory of source files to the BeagleBone, compiles | 24 This script copies a directory of source files to the BeagleBone, compiles |
25 and runs it. The BeagleRT core files should have first been copied over | 25 and runs it. The Bela core files should have first been copied over |
26 using the setup_board.sh script supplied with BeagleRT. | 26 using the setup_board.sh script supplied with Bela. |
27 | 27 |
28 The source directory should contain at least one .c, .cpp or .S file. | 28 The source directory should contain at least one .c, .cpp or .S file. |
29 If the argument -n is passed, the output will not be run after compiling. | 29 If the argument -n is passed, the output will not be run after compiling. |
30 The -c option passes command-line arguments to | 30 The -c option passes command-line arguments to |
31 the BeagleRT program; enclose the argument string in quotes. | 31 the Bela program; enclose the argument string in quotes. |
32 | 32 |
33 By default, the project runs in the foreground of the current terminal, | 33 By default, the project runs in the foreground of the current terminal, |
34 within a screen session that can be detached later. The -f argument runs | 34 within a screen session that can be detached later. The -f argument runs |
35 the project in the foreground of the current terminal, without screen, so | 35 the project in the foreground of the current terminal, without screen, so |
36 the output can be piped to another destination. The -b argument runs it | 36 the output can be piped to another destination. The -b argument runs it |
125 then | 125 then |
126 echo "Error while copying files" | 126 echo "Error while copying files" |
127 exit | 127 exit |
128 fi | 128 fi |
129 | 129 |
130 # Make new BeagleRT executable and run | 130 # Make new Bela executable and run |
131 MAKE_COMMAND="make -C $BBB_BELA_HOME PROJECT='$BBB_PROJECT_NAME' CL='$COMMAND_ARGS' $BBB_MAKEFILE_OPTIONS" | 131 MAKE_COMMAND="make -C $BBB_BELA_HOME PROJECT='$BBB_PROJECT_NAME' CL='$COMMAND_ARGS' $BBB_MAKEFILE_OPTIONS" |
132 if [ $RUN_PROJECT -eq 0 ] | 132 if [ $RUN_PROJECT -eq 0 ] |
133 then | 133 then |
134 echo "Building project..." | 134 echo "Building project..." |
135 ssh $BBB_ADDRESS "$MAKE_COMMAND" | 135 ssh $BBB_ADDRESS "$MAKE_COMMAND" |