Index: LMDZ6/trunk/makelmdz_fcm
===================================================================
--- LMDZ6/trunk/makelmdz_fcm	(revision 4283)
+++ LMDZ6/trunk/makelmdz_fcm	(revision 4426)
@@ -370,6 +370,6 @@
 then
    CPP_KEY="$CPP_KEY INCA"
-   INCLUDE="$INCLUDE -I${INCA_INCDIR}"
-   LIB="$LIB -L${INCA_LIBDIR} -lchimie"
+   INCLUDE="$INCLUDE ${INCA_INCDIR}"
+   LIB="$LIB ${INCA_LIBDIR} ${INCA_LIB}"
 fi
 
@@ -405,6 +405,6 @@
     else
 	CPP_KEY="$CPP_KEY CPP_COUPLE CPP_OMCT"
-	INCLUDE="$INCLUDE -I${OASIS_INCDIR}"
-	LIB="$LIB -L${OASIS_LIBDIR} -lpsmile.MPI1 -lscrip -lmct -lmpeu"
+	INCLUDE="$INCLUDE ${OASIS_INCDIR}"
+	LIB="$LIB ${OASIS_LIBDIR} -lpsmile.MPI1 -lscrip -lmct -lmpeu"
     fi
 fi
@@ -436,8 +436,9 @@
 if [ "$veget" = "true" -o "$veget" = "orchidee1.9" -o "$veget" = "orchidee2.0" -o "$veget" = "orchidee2.1" -o "$veget" = "orchideetrunk" ]
 then
+	echo "doing orchidee"
 #NB: option 'true': for backward compatibility. To be used with ORCHIDEE tag 1.9-1.9.6
 #    For this case, cpp flag ORCHIDEE_NOOPENMP must be added to the makelmdz_fcm arguments
 #    option orchidee1.9 : Compile with ORCHIDEE version up to the inclusion of OpenMP in ORCHIDEE : tag 1.9-1.9.5(version AR5)-1.9.6
-   INCLUDE="${INCLUDE} -I${ORCH_INCDIR}"
+   INCLUDE="${INCLUDE} ${ORCH_INCDIR}"
    CPP_KEY="$CPP_KEY CPP_VEGET"
 # temporary, for Orchidee versions 1.9.* (before openmp activation)
@@ -446,20 +447,22 @@
    fi
    if [[ "$veget" == "orchidee2.0" ]] ; then
-      orch_libs="sechiba parameters stomate parallel orglob orchidee"
+      orch_libs="-lsechiba -lparameters -lstomate -lparallel -lorglob -lorchidee"
       CPP_KEY="$CPP_KEY ORCHIDEE_NOUNSTRUCT"
    elif [[ "$veget" == "orchidee2.1" ]] ; then
       CPP_KEY="$CPP_KEY ORCHIDEE_NOLIC"
-      orch_libs="sechiba parameters stomate parallel orglob orchidee"
+      orch_libs="-lsechiba -lparameters -lstomate -lparallel -lorglob -lorchidee"
    elif [[ "$veget" == "orchideetrunk" ]] ; then
-      orch_libs="orchidee"
+      orch_libs="-lorchidee"
    else
-      orch_libs="sechiba parameters stomate parallel orglob"
+      orch_libs="-lsechiba -lparameters -lstomate -lparallel -lorglob"
    fi
-   LIB="${LIB} -L${ORCH_LIBDIR}"
-   for lib in ${orch_libs} ; do
-      if [ -f ${ORCH_LIBDIR}/lib${LIBPREFIX}$lib.a ] ; then
-         LIB="${LIB} -l${LIBPREFIX}$lib "
-      fi
-   done
+   LIB="${LIB} ${ORCH_LIBDIR} ${orch_libs}"
+#   for lib in ${orch_libs} ; do
+#      if [ -f ${ORCH_LIBDIR#-L}/lib${LIBPREFIX}$lib.a ] ; then
+#         LIB="${LIB} -l${LIBPREFIX}$lib "
+#      fi
+#   done
+   echo "orchidee lib" 
+   echo ${LIB}
 elif [[ "$veget" != "false" ]] ; then
    echo "Option -v $veget does not exist"
@@ -501,18 +504,18 @@
 then
    CPP_KEY="$CPP_KEY CPP_IOIPSL"
-   INCLUDE="$INCLUDE -I${IOIPSL_INCDIR}"
-   LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl"
+   INCLUDE="$INCLUDE ${IOIPSL_INCDIR}"
+   LIB="$LIB ${IOIPSL_LIBDIR} ${IOIPSL_LIB}"
 elif [[ $io == mix ]]
 then
    # For now, xios implies also using ioipsl
    CPP_KEY="$CPP_KEY CPP_IOIPSL CPP_XIOS"
-   INCLUDE="$INCLUDE -I${IOIPSL_INCDIR} -I${XIOS_INCDIR}"
-   LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl -L${XIOS_LIBDIR} -l${LIBPREFIX}stdc++ -l${LIBPREFIX}xios -l${LIBPREFIX}stdc++"
+   INCLUDE="$INCLUDE ${IOIPSL_INCDIR} ${XIOS_INCDIR}"
+   LIB="$LIB ${IOIPSL_LIBDIR} ${IOIPSL_LIB} ${XIOS_LIBDIR} ${XIOS_LIB}"
 elif [[ $io == xios ]]
 then
    # For now, xios implies also using ioipsl
    CPP_KEY="$CPP_KEY CPP_IOIPSL CPP_XIOS CPP_IOIPSL_NO_OUTPUT"
-   INCLUDE="$INCLUDE -I${IOIPSL_INCDIR} -I${XIOS_INCDIR}"
-   LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl -L${XIOS_LIBDIR} -l${LIBPREFIX}stdc++ -l${LIBPREFIX}xios -l${LIBPREFIX}stdc++"
+   INCLUDE="$INCLUDE ${IOIPSL_INCDIR} ${XIOS_INCDIR}"
+   LIB="$LIB ${IOIPSL_LIBDIR} ${IOIPSL_LIB} ${XIOS_LIBDIR} ${XIOS_LIB}"
 fi
 
@@ -545,5 +548,5 @@
 
 INCLUDE="$INCLUDE ${NETCDF_INCDIR}"
-LIB="$LIB ${NETCDF_LIBDIR}"
+LIB="$LIB ${NETCDF_LIBDIR} ${NETCDF_LIB}"
 
 ########################################################################
