ref: 0e6f493ea3fa9155b1f83fe129c5eb4d0f925e29
parent: 469419bfb4cf1aba6550114795b4d8615927aa3c
author: Varun B Patil <varun.basavaraj.patil@gmail.com>
date: Sun Dec 29 08:24:10 EST 2013
Linux shell scripts refactored
--- a/testbin/AutoBuild_Linux.sh
+++ b/testbin/AutoBuild_Linux.sh
@@ -1,19 +1,20 @@
#!/bin/bash
-usage="this file must located in ../testbin/ based on our code structure "
-echo $usage
+CurDir="${PWD}"
-CurDir=`pwd`
-EncoderMakeDir="../codec/build/linux/enc/"
-DecoderMakeDir="../codec/build/linux/dec/"
-VPMakeDir="../processing/build/linux/"
+if [ "$(basename ${CurDir})" != "testbin" ]; then
+ usage="This file must located in ../testbin/ based on our code structure"
+ echo ${usage}
+ exit 1
+fi
-CodecBinDir="../codec/build/linux/bin/"
+EncoderMakeDir="../codec/build/linux/enc"
+DecoderMakeDir="../codec/build/linux/dec"
+VPMakeDir="../processing/build/linux"
+
+CodecBinDir="../codec/build/linux/bin"
VPBinDir="../bin/linux"
-let "EncoderBuildFlag=1"
-let "DecoderBuildFlag=1"
-let "VPBuildFlag=1"
MakefileLogFile="${CurDir}/CodecVPBuild.log"
#************************************************
@@ -25,26 +26,10 @@
cd ${CurDir}
cd ${CodecBinDir}
-if [ ! -e welsenc.a ]
-then
- let "EncoderBuildFlag=0"
-fi
-
-if [ ! -e welsenc.so ]
-then
- let "EncoderBuildFlag=0"
-fi
-
-if [ ! -e welsenc.exe ]
-then
- let "EncoderBuildFlag=0"
-fi
-
-if [ "$EncoderBuildFlag" -eq 1 ]
-then
- echo "encoder build success!"
+if [[ ! -e welsenc.a ]] || [[ ! -e welsenc.so ]] || [[ ! -e welsenc.exe ]]; then
+ echo "encoder build failed!"
else
- echo "encoder build failed!"
+ echo "encoder build success!"
fi
#************************************************
@@ -57,26 +42,10 @@
cd ${CurDir}
cd ${CodecBinDir}
-if [ ! -e welsdec.a ]
-then
- let "DecoderBuildFlag=0"
-fi
-
-if [ ! -e welsdec.so ]
-then
- let "DecoderBuildFlag=0"
-fi
-
-if [ ! -e welsdec.exe ]
-then
- let "DecoderBuildFlag=0"
-fi
-
-if [ "$DecoderBuildFlag" -eq 1 ]
-then
- echo "decoder build success!"
+if [[ ! -e welsdec.a ]] || [[ ! -e welsdec.so ]] || [[ ! -e welsdec.exe ]]; then
+ echo "decoder build failed!"
else
- echo "decoder build failed!"
+ echo "decoder build success!"
fi
#************************************************
@@ -89,40 +58,12 @@
cd ${CurDir}
cd ${VPBinDir}
-if [ ! -e libwelsvp.so ]
-then
- let "VPBuildFlag=0"
-fi
-
-if [ "$VPBuildFlag" -eq 1 ]
-then
- echo "VP build success!"
+if [ ! -e libwelsvp.so ]; then
+ echo "VP build failed!"
else
- echo "VP build failed!"
+ echo "VP build success!"
fi
-
-#****************************
cd ${CurDir}
-rm -f *.a *.exe *.so
-
-for file in ${CodecBinDir}/*
-do
- cp ${file} ./
- echo "file ${file} under ../openh264/bin/"
-done
-
-for file in ${VPBinDir}/*
-do
- cp ${file} ./
- echo "file ${file} under ../openh264/bin/"
-done
-
-
-
-
-
-
-
-
-
+echo "executables available in ../bin/linux"
+echo "log file stored in ./CodecVPBuild.log"
--- a/testbin/AutoClean_Linux.sh
+++ b/testbin/AutoClean_Linux.sh
@@ -1,53 +1,41 @@
#!/bin/bash
-usage="this file must located in ../testbin/ based on our code structure "
-echo $usage
+CurDir="${PWD}"
-CurDir=`pwd`
-EncoderMakeDir="../codec/build/linux/enc/"
-DecoderMakeDir="../codec/build/linux/dec/"
-VPMakeDir="../processing/build/linux/"
+if [ "$(basename ${CurDir})" != "testbin" ]; then
+ usage="This file must located in ../testbin/ based on our code structure"
+ echo ${usage}
+ exit 1
+fi
-CodecBinDir="../codec/build/linux/bin/"
+EncoderMakeDir="../codec/build/linux/enc"
+DecoderMakeDir="../codec/build/linux/dec"
+VPMakeDir="../processing/build/linux"
+
+CodecBinDir="../codec/build/linux/bin"
VPBinDir="../bin/linux"
-let "EncoderBuildFlag=1"
-let "DecoderBuildFlag=1"
-let "VPBuildFlag=1"
MakefileLogFile="${CurDir}/CodecVPBuild.log"
#************************************************
#call Encoder make file
-echo "encoder cleanning....."
+echo "encoder cleaning....."
cd ${EncoderMakeDir}
-make clean >${MakefileLogFile}
-#make >>${MakefileLogFile}
+make clean
-
-
#************************************************
#call Decoder make file
-echo "decoder cleanning....."
+echo "decoder cleaning....."
cd ${CurDir}
cd ${DecoderMakeDir}
-make clean >>${MakefileLogFile}
-#make >>${MakefileLogFile}
+make clean
-
-
#************************************************
#call VP make file
-echo "VP cleanning....."
+echo "VP cleaning....."
cd ${CurDir}
cd ${VPMakeDir}
-make clean >>${MakefileLogFile}
-#make >>${MakefileLogFile}
+make clean
cd ${CurDir}
-
-rm -f *.exe *.so *.a *.log
-rm -fr ../bin # remove the bin directory
-
-
-
-
+rm -f *.exe *.so *.a *.log ../bin