Ignore:
Timestamp:
2010-10-04T14:49:55+02:00 (11 years ago)
Author:
rblod
Message:

Improvement of FCM branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DEV_r1879_FCM/NEMOGCM/TOOLS/maketools

    • Property svn:keywords set to Id
    r2136 r2143  
    1919# :: 
    2020# 
    21 #  $ makenetools 
     21#  $ maketools 
    2222# 
    2323# 
     
    6767# 
    6868# 
    69 # - rblod 2010-06-20T16:11:47Z 
    7069# 
    7170#   * creation 
     
    8887x_m=""; 
    8988x_t=""; 
     89x_c=""; 
    9090x_j=1; 
    91 while getopts :hld:n:r:m:j:t: V 
     91while getopts :hm:n:r:j:t: V 
    9292  do 
    9393    case $V in 
    9494      (h)  echo "Usage   : "${b_n} \ 
    95                 " [-h] [-l] [-n name] [-m arch] [-j No] [-t tmpdir]"; 
     95                " [-h] [-n name] [-m arch] [-j No] [-t tmpdir]"; 
    9696           echo " -h  : help"; 
    97            echo " -l        : list existing tools"; 
    98            echo " -n name : tool name"; 
    99            echo " -m arch : choose machine"; 
     97           echo " -n name : tool name, [-n help] to list existing tools"; 
     98           echo " -m arch : choose compiler, [-m help] to list exiting compilers"; 
    10099           echo " -j No  : number of processes used to compile (0=nocompilation)"; 
    101100           echo " -t dir  : remporary directory for compilation" 
     
    104103           echo "maketools -n NESTING" ; 
    105104           echo ""; 
    106            echo "Defaults    : "; 
     105                          printf "%s\n" "Available tools :" `ls ${TOOLS_DIR}|grep -v COMPILE | grep -v maketools`; 
    107106           echo ""; 
     107                          . ${COMPIL_DIR}/Flist_archfile.sh  ; 
     108           echo ""; 
     109           echo "Default : previous tool and compiler"; 
    108110           exit 0;; 
    109111      (n)  x_n=${OPTARG};; 
     
    111113      (j)  x_j=${OPTARG};; 
    112114      (t)  x_t=${OPTARG};; 
    113       (l)  echo "Available tools :"; ls ${TOOLS_DIR}|grep -v COMPILE | grep -v maketools; exit;; 
    114115      (:)  echo ${b_n}" : -"${OPTARG}" option : missing value" 1>&2; 
    115116           exit 2;; 
     
    119120  done 
    120121shift $(($OPTIND-1)); 
     122 
     123#- 
     124#- Get the clean option 
     125[[ "${#@}" -ne 0 && "${@}" != clean ]] && echo "Invalid option "$@" " && exit 
     126[ "${#@}" -ne 0 ] && x_c="--$@" 
    121127 
    122128#- 
     
    130136CMP_NAM=${x_m} 
    131137NEMO_TDIR=${x_t:-$NEMO_TDIR} 
    132 export NEMO_TDIR=${NEMO_TDIR:-$CONFIG_DIR} 
     138export NEMO_TDIR=${NEMO_TDIR:-$TOOLS_DIR} 
     139 
     140#- Check if the tool or the compiler exist or list it 
     141[ "${NEW_CONF}" == help ] && printf "%s\n"  "Available tools :" `ls ${TOOLS_DIR}|grep -v COMPILE | grep -v maketools` && exit 
     142[ "${CMP_NAM}" ==  help ] && . ${COMPIL_DIR}/Flist_archfile.sh && exit 
    133143 
    134144#- When used for the first time, choose a compiler --- 
    135145. ${COMPIL_DIR}/Fcheck_archfile.sh arch_tools.fcm ${CMP_NAM} || exit 
    136146 
     147#- Mak the building directory 
    137148. ${COMPIL_DIR}/Fmake_bld.sh ${TOOLS_DIR} ${NEW_CONF} ${NEMO_TDIR} || exit 
    138149 
     
    147158cd ${NEMO_TDIR}/${NEW_CONF} || cd - 
    148159 
    149 fcm build --ignore-lock -v 1 -j ${NBR_PRC} ${COMPIL_DIR}/bld_tools.cfg || cd - 
     160fcm build ${x_c} --ignore-lock -v 1 -j ${NBR_PRC} ${COMPIL_DIR}/bld_tools.cfg || cd - 
    150161for i in `ls ${NEMO_TDIR}/${NEW_CONF}/BLD/bin/*.exe` 
    151162   do 
     
    162173${COMPIL_DIR}/Fclean_var.sh 
    163174 
    164  
    165175exit 0; 
Note: See TracChangeset for help on using the changeset viewer.