comparison scripts/build_pd_heavy.sh @ 479:bfc60429cca6 prerelease

build_pd_heavy improved robustness for relative paths
author Giulio Moro <giuliomoro@yahoo.it>
date Tue, 21 Jun 2016 05:03:53 +0100
parents 2a0b468ce1dd
children def3b8cf9749
comparison
equal deleted inserted replaced
478:cb875406a594 479:bfc60429cca6
129 for file in $HEAVY_FILES; 129 for file in $HEAVY_FILES;
130 do 130 do
131 ls "$projectpath"/$file >/dev/null 2>&1 || { echo "The online compiler failed, please try again."; exit 1; } 131 ls "$projectpath"/$file >/dev/null 2>&1 || { echo "The online compiler failed, please try again."; exit 1; }
132 done 132 done
133 # Apply any Bela-specific patches here 133 # Apply any Bela-specific patches here
134 cp "hvresources/HvUtils.h" $projectpath/; 134 cp "$SCRIPTDIR/hvresources/HvUtils.h" $projectpath/ || exit 1;
135 135
136 BBB_PROJECT_FOLDER=$BBB_PROJECT_HOME"/"$BBB_PROJECT_NAME #make sure there is no trailing slash here 136 BBB_PROJECT_FOLDER=$BBB_PROJECT_HOME"/"$BBB_PROJECT_NAME #make sure there is no trailing slash here
137 BBB_NETWORK_TARGET_FOLDER=$BBB_ADDRESS:$BBB_PROJECT_FOLDER 137 BBB_NETWORK_TARGET_FOLDER=$BBB_ADDRESS:$BBB_PROJECT_FOLDER
138 138
139 # check how to copy/sync render.cpp file... 139 # check how to copy/sync render.cpp file...
140 # check if custom heavy/render.cpp file is provided in the input folder 140 # check if custom heavy/render.cpp file is provided in the input folder
141 # TODO: extend this to all non-Pd files 141 # TODO: extend this to all non-Pd files
142 CUSTOM_RENDER_SOURCE_PATH="$pdpath/heavy/render.cpp" 142 CUSTOM_RENDER_SOURCE_PATH="$pdpath/heavy/render.cpp"
143 if [ -f "$CUSTOM_RENDER_SOURCE_PATH" ]; then 143 if [ -f "$CUSTOM_RENDER_SOURCE_PATH" ]; then
144 echo "Found custom heavy/render.cpp file in input folder, using that one instead of the default one."; 144 echo "Found custom heavy/render.cpp file in input folder, using that one instead of the default one.";
145 cp "$CUSTOM_RENDER_SOURCE_PATH" "$projectpath/render.cpp" 145 cp "$CUSTOM_RENDER_SOURCE_PATH" "$projectpath/render.cpp" || exit 1
146 else 146 else
147 echo "Using default heavy/render.cpp" 147 echo "Using default heavy/render.cpp"
148 cp "hvresources/heavy_render.cpp" "$projectpath/render.cpp" 148 cp "$SCRIPTDIR/hvresources/heavy_render.cpp" "$projectpath/render.cpp" || exit 1
149 fi 149 fi
150 150
151 echo "Updating files on board..." 151 echo "Updating files on board..."
152 # HvContext* files tend to hang when transferring with rsync because they are very large and -c checksum takes a lot, I guess 152 # HvContext* files tend to hang when transferring with rsync because they are very large and -c checksum takes a lot, I guess
153 153
178 then 178 then
179 echo "Building project..." 179 echo "Building project..."
180 ssh $BBB_ADDRESS "$MAKE_COMMAND" 180 ssh $BBB_ADDRESS "$MAKE_COMMAND"
181 else 181 else
182 echo "Building and running project..." 182 echo "Building and running project..."
183 echo "WATCH: $WATCH"
184 if [ $WATCH -eq 1 ] 183 if [ $WATCH -eq 1 ]
185 then 184 then
186 # try to emulate run_without_screen: run with fifo 185 # try to emulate run_without_screen: run with fifo
187 [ $RUN_WITHOUT_SCREEN -eq 1 ] && { ssh $BBB_ADDRESS "$MAKE_COMMAND runscreenfifo"& BACKGROUND_PROCESS_PID=$!; } ||\ 186 [ $RUN_WITHOUT_SCREEN -eq 1 ] && { ssh $BBB_ADDRESS "$MAKE_COMMAND runscreenfifo"& BACKGROUND_PROCESS_PID=$!; } ||\
188 { ssh $BBB_ADDRESS "$MAKE_COMMAND runscreen"; } 187 { ssh $BBB_ADDRESS "$MAKE_COMMAND runscreen"; }