diff options
| author | Ben Hilburn <ben.hilburn@ettus.com> | 2014-05-14 11:42:44 -0700 | 
|---|---|---|
| committer | Ben Hilburn <ben.hilburn@ettus.com> | 2014-05-14 11:42:44 -0700 | 
| commit | 07d310ddd370d7b1cc276e44b409ecec4087eaf7 (patch) | |
| tree | becabccbda2934bd3881363c0be83f701ce1ae9a /fpga/usrp3/top/python/batch-build | |
| parent | 4c3d945a0b6a88092133e46ef80f3257f39a2a48 (diff) | |
| parent | 00711ba213dde8aa0a099d2b18d3da0a33e6af79 (diff) | |
| download | uhd-07d310ddd370d7b1cc276e44b409ecec4087eaf7.tar.gz uhd-07d310ddd370d7b1cc276e44b409ecec4087eaf7.tar.bz2 uhd-07d310ddd370d7b1cc276e44b409ecec4087eaf7.zip  | |
Merge branch 'maint'
Diffstat (limited to 'fpga/usrp3/top/python/batch-build')
| -rwxr-xr-x | fpga/usrp3/top/python/batch-build | 45 | 
1 files changed, 45 insertions, 0 deletions
diff --git a/fpga/usrp3/top/python/batch-build b/fpga/usrp3/top/python/batch-build new file mode 100755 index 000000000..fcf9ac7f5 --- /dev/null +++ b/fpga/usrp3/top/python/batch-build @@ -0,0 +1,45 @@ +#!/bin/bash + +iterations=1 +directory="." +targets="" +name="" +outdir=${PWD} + +for arg in "$@"; do +   if [[ $arg == "--help" ]]; then +      echo "Usage: batch-build [options] targets" +      echo "Options:" +      echo "   --runs=N [1]            Build the specified targets N times" +      echo "   --dir=<dir> [.]         Makefile directory" +      echo "   --name=<name> [<empty>] Name of this batch job. Used as a prefix for build output" +      echo "   --help                  Print the message and exit" +      echo "" +      exit 0 +   elif [[ $arg =~ "--runs="([0-9]+) ]]; then +      iterations=${BASH_REMATCH[1]} +   elif [[ $arg =~ "--dir="(.+) ]]; then +      directory=${BASH_REMATCH[1]} +   elif [[ $arg =~ "--name="(.+) ]]; then +      name=${BASH_REMATCH[1]}"_" +   else +      targets=$targets$arg" " +   fi +done + +cd $directory >/dev/null 2>&1 +if [ $? -ne 0 ]; then +   echo "ERROR: Could not cd to $directory" +   exit +fi + +for i in $(seq 1 $iterations); do +   make $targets +   if [ $? -ne 0 ]; then +      echo "ERROR: Build Failed!!! Stopping batch build." +      exit +   fi +   cp -rf build ${outdir}/${name}batch-build_$(date +'%Y-%m-%d_%H-%M-%S') +   make clean +done +  | 
