| [6] | 1 | #!/bin/sh -f
 | 
|---|
 | 2 | 
 | 
|---|
 | 3 | #
 | 
|---|
 | 4 | # File produced by the obuild tool version 1.0
 | 
|---|
| [101] | 5 | # for the package snovis with version v1r1.
 | 
|---|
| [6] | 6 | #
 | 
|---|
 | 7 | 
 | 
|---|
 | 8 | #////////////////////////////////////////////////
 | 
|---|
 | 9 | # Usage :
 | 
|---|
 | 10 | #   UNIX> cd some_path/pack/version/obuild
 | 
|---|
 | 11 | # ( UNIX> chmod a+x sh/build )
 | 
|---|
 | 12 | #   UNIX> sh/build
 | 
|---|
 | 13 | #
 | 
|---|
 | 14 | #////////////////////////////////////////////////
 | 
|---|
 | 15 | 
 | 
|---|
 | 16 | #obuild_args="$*"
 | 
|---|
 | 17 | 
 | 
|---|
 | 18 | obuild_verbose=no
 | 
|---|
 | 19 | obuild_debug=no
 | 
|---|
 | 20 | obuild_set_x=no
 | 
|---|
 | 21 | obuild_erase_dir_bin=no
 | 
|---|
 | 22 | obuild_do_mains=yes
 | 
|---|
 | 23 | obuild_group=main
 | 
|---|
 | 24 | 
 | 
|---|
 | 25 | obuild_args=""
 | 
|---|
 | 26 | while test $# -ge 1 ; do
 | 
|---|
 | 27 |   case $1 in
 | 
|---|
 | 28 |     -h) 
 | 
|---|
 | 29 |         echo "Usage :"
 | 
|---|
 | 30 |         echo "  UNIX> sh/build [Options] [Target]"
 | 
|---|
 | 31 |         echo "Options :"
 | 
|---|
 | 32 |         echo "  -v : verbose."
 | 
|---|
 | 33 |         echo "  -g : build in debug mode."
 | 
|---|
 | 34 |         echo "  -i : install setup scripts."
 | 
|---|
 | 35 |         echo "  -bci : broadacst install setup scripts."
 | 
|---|
 | 36 |         echo "  -e : erase binary directory."
 | 
|---|
 | 37 |         echo "  -x : execute with set -x."
 | 
|---|
 | 38 |         echo "  -l : link only, do not (re)compile."
 | 
|---|
 | 39 |         echo "  -k : do not erase result of compilations (.o, .obj)."
 | 
|---|
 | 40 |         echo "  -nm : build the not-main components."
 | 
|---|
 | 41 |         echo "  -group group : build the given group of components."
 | 
|---|
 | 42 |         echo "Target :"
 | 
|---|
 | 43 |         echo "  If no option is specify and a ending"
 | 
|---|
 | 44 |         echo " string is given ; this string is given"
 | 
|---|
 | 45 |         echo " to a find command of the form :"
 | 
|---|
 | 46 |         echo '    find ./sh -name "*target*" -exec {} \;'
 | 
|---|
 | 47 |         echo " in order to execute selected scripts under"
 | 
|---|
 | 48 |         echo " the sh directory."
 | 
|---|
 | 49 |         echo "Examples :"
 | 
|---|
 | 50 |         echo "  UNIX> sh/build app"
 | 
|---|
 | 51 |         echo "  UNIX> sh/build -v _lib"
 | 
|---|
 | 52 |         echo "  UNIX> sh/build -v -g dll_"
 | 
|---|
 | 53 |         echo ""
 | 
|---|
 | 54 |         exit ;;
 | 
|---|
 | 55 |     -v) obuild_verbose=yes;obuild_args="${obuild_args} $1" ;;
 | 
|---|
 | 56 |     -g) obuild_debug=yes;obuild_args="${obuild_args} $1" ;;
 | 
|---|
 | 57 |     -i) ./sh/install; exit ;;
 | 
|---|
 | 58 |     -bci) if [ ! -e ./sh/broadcast_install ] ; then 
 | 
|---|
 | 59 |             echo "Nothing to do for this package." 
 | 
|---|
 | 60 |             exit
 | 
|---|
 | 61 |           fi
 | 
|---|
 | 62 |           ./sh/broadcast_install ${obuild_args}
 | 
|---|
 | 63 |           exit ;;
 | 
|---|
 | 64 |     -x) obuild_set_x=yes;obuild_args="${obuild_args} $1" ;;
 | 
|---|
 | 65 |     -l) obuild_args="${obuild_args} $1" ;;
 | 
|---|
 | 66 |     -k) obuild_args="${obuild_args} $1" ;;
 | 
|---|
 | 67 |     -e) obuild_erase_dir_bin=yes ;;
 | 
|---|
 | 68 |     -nm) obuild_do_mains=no ;;
 | 
|---|
 | 69 |     -group) shift
 | 
|---|
 | 70 |         if [ $# != 0 ] ; then
 | 
|---|
 | 71 |           obuild_group=$1 
 | 
|---|
 | 72 |         else         
 | 
|---|
 | 73 |           echo "give a group name after the -group option."
 | 
|---|
 | 74 |           exit 
 | 
|---|
 | 75 |         fi ;;
 | 
|---|
 | 76 |     -*) echo "unknwon option : $1" ; exit ;;
 | 
|---|
 | 77 |      *) if [ $# = 1 ] ; then
 | 
|---|
 | 78 |           find ./sh -name "*$1*" -exec {} ${obuild_args} \;
 | 
|---|
 | 79 |         else         
 | 
|---|
 | 80 |           echo "unknwon option : $1"
 | 
|---|
 | 81 |         fi
 | 
|---|
 | 82 |         exit ;;
 | 
|---|
 | 83 |   esac
 | 
|---|
 | 84 |   shift
 | 
|---|
 | 85 | done
 | 
|---|
 | 86 | 
 | 
|---|
 | 87 | if [ ${obuild_set_x} = yes ] ; then
 | 
|---|
 | 88 |   set -x
 | 
|---|
 | 89 | fi
 | 
|---|
 | 90 | 
 | 
|---|
 | 91 | if [ ${obuild_erase_dir_bin} = "yes" ] ; then
 | 
|---|
 | 92 |   if [  "${OBUILD_PLATFORM}" = "" ] ; then
 | 
|---|
 | 93 |     obuild_platform=`uname`
 | 
|---|
 | 94 |   else
 | 
|---|
 | 95 |     obuild_platform=${OBUILD_PLATFORM}
 | 
|---|
 | 96 |   fi
 | 
|---|
 | 97 |   if [ "${obuild_platform}" = "" ] ; then
 | 
|---|
 | 98 |     echo "obuild_platform variable not defined."
 | 
|---|
 | 99 |     exit
 | 
|---|
 | 100 |   fi
 | 
|---|
 | 101 |   if [  "${OBUILD_DIR_BIN}" = "" ] ; then
 | 
|---|
 | 102 |     obuild_dir_bin=${obuild_platform}_obuild
 | 
|---|
 | 103 |   else
 | 
|---|
 | 104 |     obuild_dir_bin=${OBUILD_DIR_BIN}
 | 
|---|
 | 105 |   fi
 | 
|---|
 | 106 |   if [ "${obuild_dir_bin}" = "" ] ; then
 | 
|---|
 | 107 |     echo "obuild_dir_bin variable not defined."
 | 
|---|
 | 108 |     exit
 | 
|---|
 | 109 |   fi
 | 
|---|
 | 110 |   obuild_pwd=`pwd`
 | 
|---|
 | 111 |   obuild_snovis_path=`dirname "${obuild_pwd}"`
 | 
|---|
 | 112 |   unset obuild_pwd
 | 
|---|
 | 113 |   /bin/rm -R -f "${obuild_snovis_path}/${obuild_dir_bin}"
 | 
|---|
 | 114 |   exit  
 | 
|---|
 | 115 | fi
 | 
|---|
 | 116 | 
 | 
|---|
 | 117 | if [ "${obuild_group}" = main ] ; then
 | 
|---|
 | 118 | if [ "${obuild_do_mains}" = yes ] ; then
 | 
|---|
| [244] | 119 |   if [ -e ./sh/build_lib_G4LabCore ] ; then
 | 
|---|
 | 120 |     ./sh/build_lib_G4LabCore ${obuild_args}
 | 
|---|
| [6] | 121 |     obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
 | 
|---|
 | 122 |   fi
 | 
|---|
 | 123 | fi
 | 
|---|
 | 124 | fi
 | 
|---|
| [244] | 125 | if [ "${obuild_group}" = main ] ; then
 | 
|---|
 | 126 | if [ "${obuild_do_mains}" = yes ] ; then
 | 
|---|
 | 127 |   if [ -e ./sh/build_lib_G4LabUIOnX ] ; then
 | 
|---|
 | 128 |     ./sh/build_lib_G4LabUIOnX ${obuild_args}
 | 
|---|
 | 129 |     obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
 | 
|---|
 | 130 |   fi
 | 
|---|
 | 131 | fi
 | 
|---|
 | 132 | fi
 | 
|---|
| [6] | 133 | 
 | 
|---|
 | 134 | if [ "${obuild_group}" = main ] ; then
 | 
|---|
 | 135 | if [ "${obuild_do_mains}" = yes ] ; then
 | 
|---|
| [244] | 136 |   if [ -e ./sh/build_dll_G4Lab ] ; then
 | 
|---|
 | 137 |     ./sh/build_dll_G4Lab ${obuild_args}
 | 
|---|
| [6] | 138 |     obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
 | 
|---|
 | 139 |   fi
 | 
|---|
 | 140 | fi
 | 
|---|
 | 141 | fi
 | 
|---|
 | 142 | if [ "${obuild_group}" = main ] ; then
 | 
|---|
 | 143 | if [ "${obuild_do_mains}" = yes ] ; then
 | 
|---|
| [244] | 144 |   if [ -e ./sh/build_dll_snovis ] ; then
 | 
|---|
 | 145 |     ./sh/build_dll_snovis ${obuild_args}
 | 
|---|
| [6] | 146 |     obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
 | 
|---|
 | 147 |   fi
 | 
|---|
 | 148 | fi
 | 
|---|
 | 149 | fi
 | 
|---|
 | 150 | 
 | 
|---|
| [134] | 151 | if [ "${obuild_group}" = main ] ; then
 | 
|---|
 | 152 | if [ "${obuild_do_mains}" = yes ] ; then
 | 
|---|
| [244] | 153 |   if [ -e ./sh/build_app_prog_snovis ] ; then
 | 
|---|
 | 154 |     ./sh/build_app_prog_snovis ${obuild_args}
 | 
|---|
| [134] | 155 |     obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
 | 
|---|
 | 156 |   fi
 | 
|---|
 | 157 | fi
 | 
|---|
 | 158 | fi
 | 
|---|
 | 159 | 
 | 
|---|
| [267] | 160 | if [ "${obuild_group}" = main ] ; then
 | 
|---|
 | 161 | if [ "${obuild_do_mains}" = yes ] ; then
 | 
|---|
 | 162 |   if [ -e ./sh/build_darwin_app_prog_snovis ] ; then
 | 
|---|
 | 163 |     ./sh/build_darwin_app_prog_snovis ${obuild_args}
 | 
|---|
 | 164 |     obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
 | 
|---|
 | 165 |   fi
 | 
|---|
 | 166 | fi
 | 
|---|
 | 167 | fi
 | 
|---|
 | 168 | 
 | 
|---|
| [6] | 169 | if [ -e ./sh/install ] ; then
 | 
|---|
 | 170 |   ./sh/install
 | 
|---|
 | 171 | fi
 | 
|---|
 | 172 | 
 | 
|---|