Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Try to fix mess with exit status.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 24 Oct 2013 15:12:30 +0000 (17:12 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 24 Oct 2013 15:14:09 +0000 (17:14 +0200)
src/smpi/smpiff.in

index 7b497ea..25ea41a 100644 (file)
@@ -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}"