--- trunk/libf/make.sh 2009/07/31 15:18:47 22 +++ trunk/libf/make.sh 2011/02/22 13:49:36 40 @@ -1,52 +1,20 @@ # This is a script in Bash. # This script allows to build LMDZE into a directory other than -# "libf". Optionally, a compiler may be chosen on the command line. - -# -- 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. +# "libf". If you just want to build into "libf" with the current +# compiler file, you can invoke "make" directly. # Usage: +# make.sh [options and arguments for make] -# make.sh [-c <<>>] [options and arguments for make] - -# The file "<<>>.mk" should exist in "../Compilers" and the -# directory "<<>>" shoud exist in "$dest_dir". - -# Note that "-c" was chosen because it is not an option of "make". +set -xe -getopts :c: name -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 +compiler=gfortran -##dest_dir=$workdir/In_transit/LMDZE/Compil_prod -dest_dir=/usr/local/guez/LMDZ_work/LMDZE/Compil_prod${target:+_$target} +##dest_dir=~/Bureau/Compil_prod_$compiler +dest_dir=/save/workdir_Lionel/LMDZ_work/LMDZE/Compil_prod_$compiler # (Do not just use the name of the compiler as a directory name, it # confuses some compilers.) -set -xe -gmake -C $dest_dir -f $PWD/GNUmakefile -I$PWD $* libf_dir=$PWD +cp --update --verbose ../Compilers/$compiler.mk $dest_dir/compiler.mk +make -C $dest_dir -f $PWD/GNUmakefile $* libf_dir=$PWD