diff --git a/NPLib/scripts/buildliblist.sh b/NPLib/scripts/buildliblist.sh index eeddcd7281559a33e8c5bf50e72b9554a4897965..9cc13c3f942759cbcc3953aedf1bcba4a2d5baad 100755 --- a/NPLib/scripts/buildliblist.sh +++ b/NPLib/scripts/buildliblist.sh @@ -27,18 +27,18 @@ echo " + Creating liblist file....." outfile="liblist" # if output file exists delete it -if [ -e $outfile ] ; then - rm $outfile -fi ; +#if [ -e $outfile ] ; then +# rm $outfile +#fi ; # create output file -echo "#! /bin/bash" >> $outfile -echo "#" >> $outfile -echo "# WARNING:" >> $outfile -echo "# This file is automatically generated when NPLib libraries are built through the make command." >> $outfile -echo "# If you modify this file by hand, changes won't persist the next time you compile NPLib." >> $outfile -echo "#" >> $outfile -echo "echo -L$NPTOOL/NPLib/lib \\" >> $outfile +printf "#! /bin/bash\n" > $outfile +printf "#\n" >> $outfile +printf "# WARNING:\n" >> $outfile +printf "# This file is automatically generated when NPLib libraries are built through the make command.\n" >> $outfile +printf "# If you modify this file by hand, changes won't persist the next time you compile NPLib.\n" >> $outfile +printf "#\n" >> $outfile +printf "echo -L$NPTOOL/NPLib/lib" >> $outfile chmod a+x $outfile # loop on *.so files in lib/ directory @@ -48,11 +48,7 @@ do # remove .so extension name=${file%\.*} # replace "lib/lib" pattern by "-l" - name=$(echo $name | sed -e "s/lib\/lib/-l/g") - # add trailing \ - name="$name \\" - # add tab at the beginning - name=$(echo "\011 $name") - echo "\011 $name" >> $outfile + name=$(printf $name | sed -e "s/lib\/lib/-l/g") + printf " $name " >> $outfile fi ; done diff --git a/NPLib/scripts/makefile.sh b/NPLib/scripts/makefile.sh index 8a2120d1e49aad84319b2cbe3ef14b5285035293..21c6f7b66f2f28cfe3fc23ed5f20fa85fa37597b 100755 --- a/NPLib/scripts/makefile.sh +++ b/NPLib/scripts/makefile.sh @@ -27,9 +27,9 @@ #! /bin/bash if [ $# = 0 ] ; then - echo " + Building detector libraries....." + printf " + Building detector libraries.....\n" else - echo " + Cleaning $2 libraries....." + printf " + Cleaning $2 libraries.....\n" fi ; # read .detector_libs or .core_libs file created by the configure script @@ -47,9 +47,9 @@ do # file name in lower case lname=$(echo "$name" | tr '[A-Z]' '[a-z]') # only build defined detector libraries - if echo "$detectorlibs" | grep -q "$lname" ; then + if printf "$detectorlibs" | grep -q "$lname" ; then # print informations - echo "\011Entering $name directory..." + printf "\tEntering $name directory...\n" # add "-C ./" pattern at the beginning of the name cmd="-C ./$name" # execute make command with target specified on command line diff --git a/NPLib/scripts/makefile_detector.sh b/NPLib/scripts/makefile_detector.sh index 9c650d3b6d6c496559a8c0658081f9c48e32efae..814a766ca8bfdebbacc775924a66cbdc1b3370ea 100755 --- a/NPLib/scripts/makefile_detector.sh +++ b/NPLib/scripts/makefile_detector.sh @@ -28,19 +28,19 @@ # build message -echo -e "\t@echo \"Entering $1 directory...\"" >> $2 +printf "\t@echo \"Entering $1 directory...\"" >> $2 # execute make command with target specified on command line -echo -e "\tmake --silent -C ./$1" >> $2 +printf "\tmake --silent -C ./$1" >> $2 # copy header files -echo -e "\tcd $1; cp -f *.h ../include" >> $2 +printf "\tcd $1; cp -f *.h ../include" >> $2 # remove *Dict header files -echo -e "\tcd include; rm *Dict.h" >> $2 +printf "\tcd include; rm *Dict.h" >> $2 # copy library files -echo -e "\tcd $1; cp -f *.so ../lib" >> $2 +printf "\tcd $1; cp -f *.so ../lib" >> $2 # deal with mac osx dylib files #echo "ifeq (\$(findstring macosx, \$(ARCH)), macosx)" >> $2 #echo "\t@echo \"to be done\"" #echo "endif" >> $2 # newline -echo "" >> $2 +printf "" >> $2