Mercurial > hg > beaglert
changeset 472:c8dd56aed76d prerelease
Pd projects are build just like regular projects, so no need for run_pd_libpd anymore
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Mon, 20 Jun 2016 18:23:05 +0100 |
parents | cbe68fc0e933 |
children | 2a0b468ce1dd |
files | scripts/build_project.sh scripts/run_pd_libpd.sh |
diffstat | 2 files changed, 4 insertions(+), 86 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/build_project.sh Mon Jun 20 18:06:29 2016 +0100 +++ b/scripts/build_project.sh Mon Jun 20 18:23:05 2016 +0100 @@ -75,14 +75,11 @@ fi FIND_STRING="find $* -maxdepth 10000 -type f " - -C_FILES=$($FIND_STRING -name "*.c") -CPP_FILES=$($FIND_STRING -name "*.cpp") -ASM_FILES=$($FIND_STRING -name "*.S") - -if [ -z "$C_FILES" ] && [ -z "$CPP_FILES" ] && [ -z "$ASM_FILES" ] +EXTENSIONS_TO_FIND='\.cpp\|\.c\|\.S\|\.pd' +FOUND_FILES=$($FIND_STRING | grep "$EXTENSIONS_TO_FIND") +if [ -z "$FOUND_FILES" ] then - echo "Please provide a directory containing .c, .cpp or .S files." + printf "ERROR: Please provide a directory containing .c, .cpp, .S or .pd files.\n\n" # echo "Usage: $THIS_SCRIPT [directory-with-source-files]" usage exit
--- a/scripts/run_pd_libpd.sh Mon Jun 20 18:06:29 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -#!/bin/sh -# -# This script compiles a Bela project on the BeagleBone Black and -# optionally runs it. Pass a directory path in the first argument. -# The source files in this directory are copied to the board and compiled. - -SCRIPTDIR=$(dirname "$0") -[ -z $SCRIPTDIR ] && SCRIPTDIR="./" || SCRIPTDIR=$SCRIPTDIR/ -. $SCRIPTDIR.bela_common || { echo "You must be in Bela/scripts to run these scripts" | exit 1; } - -RUN_PROJECT=1 -COMMAND_ARGS= -RUN_IN_FOREGROUND=0 -RUN_WITHOUT_SCREEN=0 - -usage() -{ - THIS_SCRIPT=`basename "$0"` - echo "Usage: $THIS_SCRIPT [-c 'command-line-args'] [-nfb] <directory-with-source-files>" - echo " - This script copies a PureData project to the BeagleBone and runs it - using libpd. The Bela-libpd executable should have first been copied - to the $BBB_LIBPD_EXECUTABLE_PATH folder on the Beaglebone. - The source directory should contain a file called _main.pd, which is the - patch that will be loaded into Pd. All the content of the folder is - recursively copied and the folder structure is flattened. - - If the argument -n is passed, the output will not be run after copying the files. - - The -c option passes command-line arguments to the Bela program; - enclose the argument string in quotes. - - The -b argument runs the projet in the background, so that no output is displayed - in the terminal. - The -f argument runs the project in the foreground of the current terminal, - without screen, so the output can be piped to another destination." -} - -OPTIND=1 - -while getopts "bc:nfFh" opt; do - case $opt in - c) - COMMAND_ARGS=$OPTARG - ;; - b) - RUN_IN_FOREGROUND=0 - ;; - f) - RUN_WITHOUT_SCREEN=1 - ;; - n) - RUN_PROJECT=0 - ;; - h|\?) - usage - exit 1 - esac -done - -shift $((OPTIND-1)) - -# Check that we have a directory containing at least one source file -# as an argument - -ADDITIONAL_FOLDER=$1 - -if [ -z "$ADDITIONAL_FOLDER" ] -then - usage - exit -fi - -#reconstruct the command line options -OPT= -[ $RUN_IN_FOREGROUND -eq 0 ] && OPT="$OPT -b" -[ $RUN_WITHOUT_SCREEN -eq 1 ] && OPT="$OPT -f" - -./build_project.sh -p libpd -r $ADDITIONAL_FOLDER $OPT -c "$COMMAND_ARGS" ../examples/basic_libpd/