# ----------------------- FCM extract configuration file -----------------------
cfg::type                           bld
cfg::version                        1.0


# ------------------------------------------------------------------------------
# Build information
# ------------------------------------------------------------------------------


inc arch.fcm
inc config.fcm

%ROOT_PATH         $PWD
%CONFIG_PATH       %ROOT_PATH/.config
%SRC_PATH          %ROOT_PATH


src::global       %SRC_PATH/src_global
src::parallel     %SRC_PATH/src_parallel
src::sechiba      %SRC_PATH/src_sechiba
src::stomate      %SRC_PATH/src_stomate
src::parameters   %SRC_PATH/src_parameters
src::orchidee_ol  %SRC_PATH/src_driver
src::orchoasis    %SRC_PATH/src_oasisdriver
src::ext_src      %EXT_SRC

bld::lib::global         orglob
bld::lib::parallel       parallel
bld::lib::sechiba        sechiba
bld::lib::stomate        stomate
bld::lib::parameters     parameters
bld::lib::orchidee_ol    orchidee_ol
bld::lib::orchoasis    	 orchoasis
bld::lib                 orchidee

bld::target              liborglob.a libparallel.a libsechiba.a libstomate.a libparameters.a liborchidee.a liborchoasis.a
bld::target              %EXEC
bld::exe_dep             ext_src global parallel sechiba stomate parameters orchidee_ol orchoasis

dir::root            %CONFIG_PATH
dir::lib             %ROOT_PATH/lib
dir::bin             %ROOT_PATH/bin
dir::inc             %ROOT_PATH/lib
dir::tmp             %ROOT_PATH/tmp_src

#search_src           1

bld::tool::fc        %COMPILER 
bld::tool::ld        %LINK
bld::tool::ar        %AR
bld::tool::make      %MAKE
bld::tool::fflags    %FFLAGS %INCDIR
bld::tool::ldflags   %LD_FFLAGS %LIBDIR -lioipsl -lnetcdf   

bld::tool::cppflags  %FPP_FLAGS %INCDIR
bld::tool::fppflags  %FPP_FLAGS %INCDIR
bld::tool::fppkeys   %CPP_KEY


# Pre-process code before analysing dependencies
bld::pp              1
infile_ext::f90 fpp::fpp9x::source

# Ignore the following dependencies
bld::excl_dep        inc::netcdf.inc
bld::excl_dep        use::netcdf
bld::excl_dep        h::netcdf.inc
bld::excl_dep        h::mpif.h
bld::excl_dep        inc::mpif.h
bld::excl_dep        use::ioipsl
bld::excl_dep        USE::defprec
bld::excl_dep        USE::calendar
bld::excl_dep        USE::xios
bld::excl_dep        USE::mod_oasis

# Don't generate interface files
bld::tool::geninterface none

# Allow ".inc" as an extension for CPP include files
bld::infile_ext::inc  CPP::INCLUDE

# extension for module output
bld::outfile_ext::mod .mod
bld::tool::SHELL   /bin/bash
