/[lmdze]/trunk/libf/make.sh
ViewVC logotype

Diff of /trunk/libf/make.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 38 by guez, Thu Jan 6 17:52:19 2011 UTC revision 40 by guez, Tue Feb 22 13:49:36 2011 UTC
# Line 1  Line 1 
1  # This is a script in Bash.  # This is a script in Bash.
2    
3  # This script allows to build LMDZE into a directory other than  # This script allows to build LMDZE into a directory other than
4  # "libf". Optionally, a compiler may be chosen on the command line.  # "libf". If you just want to build into "libf" with the current
5    # compiler file, you can invoke "make" directly.
 # -- If a compiler is chosen on the command line then the script links  
 # a compiler file to the directory "libf" and builds LMDZE into a  
 # directory associated to the chosen compiler.  
   
 # -- If the compiler is not chosen on the command line and a compiler  
 # file already exists in "libf" then the script builds LMDZE with that  
 # compiler into the directory associated to it.  
   
 # -- If the compiler is not chosen on the command line and there is no  
 # compiler file in "libf" then the script builds LMDZE with the  
 # default compiler macros of make into a default directory. The  
 # default directory is defined in the script.  
   
 # If you just want to build into "libf" with the current compiler  
 # file, you can invoke "make" directly.  
6    
7  # Usage:  # Usage:
8    # make.sh [options and arguments for make]
9    
10  # make.sh [-c <<<compiler>>>] [options and arguments for make]  set -xe
   
 # The file "<<<compiler>>>.mk" should exist in "../Compilers" and the  
 # directory "<<<compiler>>>" shoud exist in "$dest_dir".  
   
 # Note that "-c" was chosen because it is not an option of "make".  
11    
12  getopts :c: name  compiler=gfortran
 if ((($? == 0)) && [[ $name = c ]])  
     then  
     echo "Linking \"$OPTARG.mk\"..."  
     ln -sf ../Compilers/$OPTARG.mk compiler.mk  
     target=$OPTARG  
     shift $((OPTIND - 1))  
 else  
     # Find the current compiler, if any:  
     if [[ -L compiler.mk ]]  
         then  
         target=`basename $(readlink compiler.mk) .mk`  
     fi  
 fi  
13    
14  ##dest_dir=~/Bureau/Compil_prod${target:+_$target}  ##dest_dir=~/Bureau/Compil_prod_$compiler
15  dest_dir=/save/workdir_Lionel/LMDZ_work/LMDZE/Compil_prod${target:+_$target}  dest_dir=/save/workdir_Lionel/LMDZ_work/LMDZE/Compil_prod_$compiler
16  # (Do not just use the name of the compiler as a directory name, it  # (Do not just use the name of the compiler as a directory name, it
17  # confuses some compilers.)  # confuses some compilers.)
18    
19  set -xe  cp --update --verbose ../Compilers/$compiler.mk $dest_dir/compiler.mk
20  make -C $dest_dir -f $PWD/GNUmakefile -I$PWD $* libf_dir=$PWD  make -C $dest_dir -f $PWD/GNUmakefile $* libf_dir=$PWD

Legend:
Removed from v.38  
changed lines
  Added in v.40

  ViewVC Help
Powered by ViewVC 1.1.21