Changeset 2743 for LMDZ5/trunk/makelmdz


Ignore:
Timestamp:
Jan 5, 2017, 4:39:47 PM (7 years ago)
Author:
Ehouarn Millour
Message:

Adapted makelmdz_fcm to be able to source an arch-*.env file, and also added option -arch_path to specify path to directory where arch files can be found.
Likewise adapted makelmdz with these options.
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/makelmdz

    r2690 r2743  
    3131strataer=false
    3232full=""
     33
     34arch_defined="FALSE"
     35arch_path="arch"
     36arch_default_path="arch"
    3337
    3438# guess a default 'arch'
     
    127131[-fcm_path path]           : path to the fcm tool (default: tools/fcm/bin)
    128132[-ext_src path]            : path to an additional set of routines to compile with the model
     133[-arch_path path]          : path to architecture files (default: $arch_default_path)
    129134 -arch nom_arch            : target architecture
    130135 exec                      : executable to build
     
    204209
    205210      "-arch")
    206           arch=$2 ; shift ; shift ;;
     211          arch=$2 ; arch_defined="TRUE" ; shift ; shift ;;
     212
     213      "-arch_path")
     214          arch_path=$2 ; arch_path_defined="TRUE"; shift ; shift ;;
    207215
    208216      *)
     
    218226rm -rf .void_dir
    219227mkdir .void_dir
    220 rm -f arch.path
    221 if [[ -r arch/arch-${arch}.path ]]
    222 then
    223   ln -s arch/arch-${arch}.path ./arch.path
     228
     229if [[ "$arch_defined" == "TRUE" ]]
     230then
     231  rm -f arch.path
     232  rm -f arch.fcm
     233  rm -f arch.env
     234
     235  if test -f $arch_path/arch-${arch}.path
     236  then
     237    ln -s $arch_path/arch-${arch}.path arch.path
     238  elif test -f $arch_default_path/arch-${arch}.path
     239  then
     240    ln -s $arch_default_path/arch-${arch}.path arch.path
     241  fi
     242       
     243  if test -f $arch_path/arch-${arch}.fcm
     244  then
     245    ln -s $arch_path/arch-${arch}.fcm arch.fcm
     246  elif test -f $arch_default_path/arch-${arch}.fcm
     247  then
     248    ln -s $arch_default_path/arch-${arch}.fcm arch.fcm
     249  fi
     250
     251  if test -f $arch_path/arch-${arch}.env
     252  then
     253    ln -s $arch_path/arch-${arch}.env arch.env
     254  elif test -f $arch_default_path/arch-${arch}.env
     255  then
     256    ln -s $arch_default_path/arch-${arch}.env arch.env
     257  else
     258    ln -s .void_file arch.env
     259  fi
     260  # source architecture PATH and ENV files
     261  source arch.env
    224262  source arch.path
    225263else
    226   echo "Error: missing arch/arch-${arch}.path file !"
    227   exit
    228 fi
    229 rm -f arch.fcm
    230 if [[ -r arch/arch-${arch}.fcm ]]
    231 then
    232   ln -s arch/arch-${arch}.fcm arch.fcm
    233 else
    234   echo "Error: missing arch/arch-${arch}.fcm file !"
    235   exit
    236 fi
     264  echo "You must define a target architecture"
     265  exit 1
     266fi
     267
    237268########################################################################
    238269# Definition des clefs CPP, des chemins des includes et modules
Note: See TracChangeset for help on using the changeset viewer.