Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
more bash->sh changes
[simgrid.git] / src / smpi / smpiff.in
index 7b497ea..b41515a 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/bash
+#! /bin/sh
 prefix="@exec_prefix@"
 
 ARGS="-DMAIN__=user_main -Diargc_=smpi_process_argc -Dgetarg_=smpi_process_getarg"
@@ -34,10 +34,12 @@ then
       cp ${SRCFILE} ${TMPFILE}
       CFILE="${TMPFILE%.f}.c"
       #echo "$prefix/bin/smpif2c ${TMPFILE} && $prefix/bin/smpicc ${ARGS} ${CFILE} && rm ${CFILE} && rm ${TMPFILE}"
-      $prefix/bin/smpif2c ${TMPFILE} && $prefix/bin/smpicc ${ARGS} ${CFILE} && rm ${CFILE} && rm ${TMPFILE}
+      $prefix/bin/smpif2c ${TMPFILE} && $prefix/bin/smpicc ${ARGS} ${CFILE} && rm ${CFILE} && rm ${TMPFILE} || exit $?
       # When the file is compiled with "-c" and no output file is specified with
-      # "-o", rename the output.
-      test -f ${CFILE%.c}.o && mv ${CFILE%.c}.o ${SRCFILE%.f}.o
+      # "-o", rename the output.  FIXME: do it properly.
+      if [ -f ${CFILE%.c}.o ]; then
+          mv ${CFILE%.c}.o ${SRCFILE%.f}.o
+      fi
    done
 else
    #echo "$prefix/bin/smpicc ${ARGS}"