Mercurial > hg > beaglert
comparison scripts/build_project.sh @ 435:cea66c2af560 prerelease
build_project was made more silent
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Fri, 17 Jun 2016 04:52:43 +0100 |
parents | 2e01a9d6cb58 |
children | ad3f61134bb4 |
comparison
equal
deleted
inserted
replaced
434:26f3ecfdf3ad | 435:cea66c2af560 |
---|---|
91 BBB_PROJECT_FOLDER=$BBB_PROJECT_HOME"/"$BBB_PROJECT_NAME #make sure there is no trailing slash here | 91 BBB_PROJECT_FOLDER=$BBB_PROJECT_HOME"/"$BBB_PROJECT_NAME #make sure there is no trailing slash here |
92 BBB_NETWORK_TARGET_FOLDER=$BBB_ADDRESS:$BBB_PROJECT_FOLDER | 92 BBB_NETWORK_TARGET_FOLDER=$BBB_ADDRESS:$BBB_PROJECT_FOLDER |
93 | 93 |
94 echo "Stopping running process..." | 94 echo "Stopping running process..." |
95 # sets the date and stop running process | 95 # sets the date and stop running process |
96 ssh $BBB_ADDRESS "date -s '`date`' > /dev/null; mkdir -p $BBB_PROJECT_FOLDER; make -C $BBB_BELA_HOME stop" | 96 ssh $BBB_ADDRESS "date -s '`date`' > /dev/null; mkdir -p $BBB_PROJECT_FOLDER; make --no-print-directory -C $BBB_BELA_HOME stop" |
97 | 97 |
98 #concatenate arguments to form path. | 98 #concatenate arguments to form path. |
99 HOST_SOURCE_PATH= #initially empty, will be filled with input arguments | 99 HOST_SOURCE_PATH= #initially empty, will be filled with input arguments |
100 for i in "$@" #parse input arguments | 100 for i in "$@" #parse input arguments |
101 do | 101 do |
108 echo "Copying new source files to BeagleBone..." | 108 echo "Copying new source files to BeagleBone..." |
109 if [ -z `which rsync` ]; | 109 if [ -z `which rsync` ]; |
110 then | 110 then |
111 #if rsync is not available, brutally clean the destination folder | 111 #if rsync is not available, brutally clean the destination folder |
112 #and copy over all the files again and recompile them | 112 #and copy over all the files again and recompile them |
113 ssh bbb "make -C $BBB_BELA_HOME sourceclean PROJECT=$BBB_PROJECT_NAME"; | 113 ssh bbb "make --no-print-directory -C $BBB_BELA_HOME sourceclean PROJECT=$BBB_PROJECT_NAME"; |
114 scp $HOST_SOURCE_PATH "$BBB_NETWORK_TARGET_FOLDER" | 114 scp $HOST_SOURCE_PATH "$BBB_NETWORK_TARGET_FOLDER" |
115 else | 115 else |
116 #rsync | 116 #rsync |
117 # --delete makes sure it removes files that are not in the origin folder | 117 # --delete makes sure it removes files that are not in the origin folder |
118 # -c evaluates changes using md5 checksum instead of file date, so we don't care about time skews | 118 # -c evaluates changes using md5 checksum instead of file date, so we don't care about time skews |
119 # --no-t makes sure file timestamps are not preserved, so that the Makefile will not think that targets are up to date when replacing files on the BBB | 119 # --no-t makes sure file timestamps are not preserved, so that the Makefile will not think that targets are up to date when replacing files on the BBB |
120 # with older files from the host. This will solve 99% of the issues with Makefile thinking a target is up to date when it is not. | 120 # with older files from the host. This will solve 99% of the issues with Makefile thinking a target is up to date when it is not. |
121 | 121 |
122 echo rsync -avc --no-t --delete-after --exclude=$BBB_PROJECT_NAME --exclude=build $HOST_SOURCE_PATH"/" "$BBB_NETWORK_TARGET_FOLDER/" #trailing slashes used here make sure rsync does not create another folder inside the target folder | |
123 rsync -avc --no-t --delete-after --exclude=$BBB_PROJECT_NAME --exclude=build $HOST_SOURCE_PATH"/" "$BBB_NETWORK_TARGET_FOLDER/" #trailing slashes used here make sure rsync does not create another folder inside the target folder | 122 rsync -avc --no-t --delete-after --exclude=$BBB_PROJECT_NAME --exclude=build $HOST_SOURCE_PATH"/" "$BBB_NETWORK_TARGET_FOLDER/" #trailing slashes used here make sure rsync does not create another folder inside the target folder |
124 fi; | 123 fi; |
125 | 124 |
126 if [ $? -ne 0 ] | 125 if [ $? -ne 0 ] |
127 then | 126 then |
128 echo "Error while copying files" | 127 echo "Error while copying files" |
129 exit | 128 exit |
130 fi | 129 fi |
131 | 130 |
132 # Make new Bela executable and run | 131 # Make new Bela executable and run |
133 MAKE_COMMAND="make -C $BBB_BELA_HOME PROJECT='$BBB_PROJECT_NAME' CL='$COMMAND_ARGS' $BBB_MAKEFILE_OPTIONS" | 132 MAKE_COMMAND="make --no-print-directory -C $BBB_BELA_HOME PROJECT='$BBB_PROJECT_NAME' CL='$COMMAND_ARGS' $BBB_MAKEFILE_OPTIONS" |
134 if [ $RUN_PROJECT -eq 0 ] | 133 if [ $RUN_PROJECT -eq 0 ] |
135 then | 134 then |
136 echo "Building project..." | 135 echo "Building project..." |
137 ssh $BBB_ADDRESS "$MAKE_COMMAND" | 136 ssh $BBB_ADDRESS "$MAKE_COMMAND" |
138 else | 137 else |