comparison scripts/.bela_common @ 523:42f6af3a5f1d prerelease

build_project and build_pd_heavy mostly done
author Giulio Moro <giuliomoro@yahoo.it>
date Thu, 23 Jun 2016 04:31:09 +0100
parents c774bd8ad108
children 1ca196e35105
comparison
equal deleted inserted replaced
522:a084456960c9 523:42f6af3a5f1d
13 13
14 trap "echo; exit 0;" 2 9 14 trap "echo; exit 0;" 2 9
15 folder_has_changed(){ 15 folder_has_changed(){
16 [ -z "$2" ] && { echo "Error: folder_has_changed(folder, reference, [filter])"; return 1; } 16 [ -z "$2" ] && { echo "Error: folder_has_changed(folder, reference, [filter])"; return 1; }
17 [ -z "$3" ] && FILTER="." || FILTER="$3" 17 [ -z "$3" ] && FILTER="." || FILTER="$3"
18 find "$1" -type f -newer "$2" | grep "$FILTER" 18 # Do not watch hidden files or folders
19 find "$1" -type f -not -path '*/\.*' -newer "$2" | grep "$FILTER"
19 return $? 20 return $?
20 } 21 }
21 22
22 wait_for_change(){ 23 wait_for_change(){
23 [ -z "$2" ] && { echo "Error: folder_has_changed(folder, reference, [filter])"; return 1; } 24 [ -z "$2" ] && { echo "Error: folder_has_changed(folder, reference, [filter])"; return 1; }
38 ssh -o ConnectTimeout=10 $BBB_ADDRESS exit && printf "done\n" || { 39 ssh -o ConnectTimeout=10 $BBB_ADDRESS exit && printf "done\n" || {
39 printf "\nERROR: the board does not respond at $BBB_ADDRESS, check that the address is correct and the board is connected.\n"; 40 printf "\nERROR: the board does not respond at $BBB_ADDRESS, check that the address is correct and the board is connected.\n";
40 exit 1; 41 exit 1;
41 } 42 }
42 } 43 }
44
45 build_script_usage(){
46 echo " The program can be run in one of the following modes:
47 -f arg : runs in the foreground (default).
48 -b arg : runs in the background (no output is shown)
49
50 When running in the foreground you can stop the currently running program
51 with ctrl-C.
52 When running in the background, you can use \`./stop_running.sh' to stop
53 the current process and \`./connect_to_project.sh' to see the program's output.
54
55 Other options:
56 --clean : cleans the pre-compiled object files on the board (same as \`-m coreclean').
57 If the linker issues warnings during a build, or you see that your latest changes are not
58 being applied to the running program, try to add the --clean flag for the next build and see
59 if that fixes it.
60
61 --watch: the script will wait for changes in the source folder and when it detects them it
62 triggers a new build. If you do not run the program with -b, then you will have to
63 either kill the process or detach from the screen in order for the watchdog to be active.
64 -n : the output will not be run after compiling.
65 -c \"args\" : passes command-line arguments to the Bela program; e
66 close the argument string in quotes.
67 -p arg : sets the name of the project to in the remote folder (default: $BBB_PROJECT_NAME )
68 do not use spaces in your project names, please
69 -m \"args\" allows to pass arguments to the Makefile before the run target. For instance,
70 pass -m \`"projectclean"\` or \`-m "distclean"\` to clean project-specific
71 pre-built objects, or all the pre-built objects, respectively.
72 "
73 }