changeset 295:e63d35c6ae96 prerelease

Defaulting to gcc compiler (see #1695), updates to build_pd_heavy to make it compile with the new Makefile
author Giulio Moro <giuliomoro@yahoo.it>
date Wed, 25 May 2016 00:18:37 +0100
parents 9e5156589124
children a3d83ebdf49b
files Makefile scripts/build_pd_heavy.sh
diffstat 2 files changed, 23 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Tue May 24 01:18:57 2016 +0100
+++ b/Makefile	Wed May 25 00:18:37 2016 +0100
@@ -46,13 +46,13 @@
 
 ifndef COMPILER
 # check whether clang is installed
-    TEST_COMPILER := $(shell which clang)
-  ifneq ($(strip $(TEST_COMPILER)), )
+#    TEST_COMPILER := $(shell which clang)
+#  ifneq ($(strip $(TEST_COMPILER)), )
     # if it is installed, use it
-    COMPILER := clang
-  else
+#    COMPILER := clang
+#  else
     COMPILER := gcc
-  endif
+#  endif
 endif
 
 ifeq ($(COMPILER), clang)
--- a/scripts/build_pd_heavy.sh	Tue May 24 01:18:57 2016 +0100
+++ b/scripts/build_pd_heavy.sh	Wed May 25 00:18:37 2016 +0100
@@ -15,8 +15,11 @@
 FORCE="0"
 #make sure the paths have the trailing / . 
 projectpath="../projects/heavy/hvtemp/"
-BBB_PATH="~/BeagleRT/"
-BBB_ADDRESS="root@192.168.7.2"
+[ -z "$BBB_ADDRESS" ] && BBB_ADDRESS="root@192.168.7.2"
+[ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/BeagleRT/"
+[ -z "$BBB_PROJECT_HOME" ] && BBB_PROJECT_HOME="${BBB_BELA_HOME}/projects/"
+BBB_DEFAULT_PROJECT_NAME="heavyProject"
+[ -z "$BBB_PROJECT_NAME" ] && BBB_PROJECT_NAME=$BBB_DEFAULT_PROJECT_NAME
 COMMAND_ARGS=
 RUN_PROJECT=1
 RUN_IN_FOREGROUND=0
@@ -56,7 +59,7 @@
 while [ "$1" != "" ]; do
     case $1 in
         -b | --bbb )            shift
-                                BBB_PATH=$1
+                                BBB_BELA_HOME=$1
                                 ;;
         -f | --force)           FORCE="1"
                                 ;;
@@ -145,11 +148,13 @@
 
     echo "updating files on board..."
 
-    rsync -c -rv --exclude 'HvContext*' "$projectpath"/ "$BBB_ADDRESS":"$BBB_PATH"/source;
-    # rsync -c -rv "$projectpath"/ "$BBB_ADDRESS":"$BBB_PATH"/source;
+    BBB_PROJECT_FOLDER=$BBB_PROJECT_HOME"/"$BBB_PROJECT_NAME #make sure there is no trailing slash here
+    BBB_NETWORK_TARGET_FOLDER=$BBB_ADDRESS:$BBB_PROJECT_FOLDER
+    rsync -c -rv --exclude 'HvContext*' "$projectpath"/ "$BBB_NETWORK_TARGET_FOLDER";
+    # rsync -c -rv "$projectpath"/ "$BBB_ADDRESS":"$BBB_BELA_HOME"/source;
 
     # for whatever reason these big files used to hang when transferring with rsync
-    scp "$projectpath"/HvContext* "$BBB_ADDRESS":"$BBB_PATH"/source;
+    scp "$projectpath"/HvContext* $BBB_NETWORK_TARGET_FOLDER
 
     if [ $? -ne 0 ]; then
     echo "";
@@ -160,11 +165,11 @@
     # exit
     #produce a list of files which content has changed (not just the date)
     #TODO: could be made faster (perhaps) by backing up the folder locally instead of bbb
-    # UPDATED_FILES=`rsync -naic --log-format="%f" "$projectpath" "$BBB_PATH"/source | grep -v "\.$"`
+    # UPDATED_FILES=`rsync -naic --log-format="%f" "$projectpath" "$BBB_BELA_HOME"/source | grep -v "\.$"`
     # echo "UPDATEDFILES : $UPDATED_FILES"
     # exit 2
     # remove old executable and heavy context .o/.d files
-    ssh $BBB_ADDRESS "rm -rf $BBB_PATH/BeagleRT $BBB_PATH/build/source/HvContext_bbb.d $BBB_PATH/build/source/HvContext_bbb.o $BBB_PATH/build/source/render.o $BBB_PATH/build/source/render.d";
+    ssh $BBB_ADDRESS "rm -rf "$BBB_PROJECT_FOLDER/$BBB_PROJECT_NAME;
     SCREEN_NAME=BeagleRT
     KILL_RUNNING_PROCESS="bash -c 'kill -s 2 \`pidof BeagleRT\` 2>/dev/null; screen -r $SCREEN_NAME -X quit 2>/dev/null; sleep 0.5; exit 0'" #always returns true
     # Make new BeagleRT executable and run
@@ -173,19 +178,20 @@
     if [ $RUN_PROJECT -eq 0 ]
     then
         echo "Building project..."
-        ssh $BBB_ADDRESS "make all -C $BBB_PATH"
+        ssh $BBB_ADDRESS "make all -C $BBB_BELA_HOME PROJECT=$BBB_PROJECT_NAME"
     else
         echo "Building and running project..."
         if [ $RUN_WITHOUT_SCREEN -eq 1 ]
         then
-            ssh -t $BBB_ADDRESS "make all -C $BBB_PATH && $KILL_RUNNING_PROCESS && $BBB_PATH/BeagleRT $COMMAND_ARGS" 
+            ssh -t $BBB_ADDRESS "make all -C $BBB_BELA_HOME  PROJECT=$BBB_PROJECT_NAME && $KILL_RUNNING_PROCESS && $BBB_PROJECT_FOLDER/$BBB_PROJECT_NAME $COMMAND_ARGS" 
         elif [ $RUN_IN_FOREGROUND -eq 1 ]
         then
             # Run in screen without detaching
-            ssh -t $BBB_ADDRESS "make all -C $BBB_PATH && $KILL_RUNNING_PROCESS && screen -S $SCREEN_NAME $BBB_PATH/BeagleRT $COMMAND_ARGS"
+            ssh -t $BBB_ADDRESS "make all -C $BBB_BELA_HOME  PROJECT=$BBB_PROJECT_NAME&& $KILL_RUNNING_PROCESS && screen -S $SCREEN_NAME $BBB_PROJECT_FOLDER/$BBB_PROJECT_NAME $COMMAND_ARGS"
         else
             # Run in screen and detach
-            ssh $BBB_ADDRESS "make all -C $BBB_PATH && $KILL_RUNNING_PROCESS && screen -dmS $SCREEN_NAME $BBB_PATH/BeagleRT $COMMAND_ARGS"
+            ssh $BBB_ADDRESS "make all -C $BBB_BELA_HOME  PROJECT=$BBB_PROJECT_NAME && $KILL_RUNNING_PROCESS && screen -dmS $SCREEN_NAME $BBB_PROJECT_FOLDER/$BBB_PROJECT_NAME $COMMAND_ARGS"
+	    
         fi
     fi
 } #checkUploadBuildRun