# HG changeset patch # User John W. Eaton # Date 1260427755 18000 # Node ID f26a33e21db9794e865527a1d5bdf8acb8d3cbda # Parent 33537a4d223ff5d0e00fcecdd7ca3afa97f1009e mkoctfile: when compiling files in subdirectories, place object files in current directory by default diff -r 33537a4d223f -r f26a33e21db9 ChangeLog --- a/ChangeLog Thu Dec 10 01:28:26 2009 -0500 +++ b/ChangeLog Thu Dec 10 01:49:15 2009 -0500 @@ -1,3 +1,9 @@ +2009-12-10 John W. Eaton + + * mkoctfile.in, mkoctfile.cc.in: When compiling files in + subdirectories, place object files in current directory by + default. + 2009-12-10 John W. Eaton * mkoctfile.cc.in: Accept long options with single -. diff -r 33537a4d223f -r f26a33e21db9 mkoctfile.cc.in --- a/mkoctfile.cc.in Thu Dec 10 01:28:26 2009 -0500 +++ b/mkoctfile.cc.in Thu Dec 10 01:49:15 2009 -0500 @@ -581,7 +581,7 @@ { for (it = cfiles.begin (); it != cfiles.end (); ++it) { - string f = *it, dfile = basename (f) + ".d", line; + string f = *it, dfile = basename (f, true) + ".d", line; unlink (dfile.c_str ()); string cmd = vars["CC"] + " " + vars["DEPEND_FLAGS"] + " " @@ -609,7 +609,7 @@ for (it = ccfiles.begin (); it != ccfiles.end (); ++it) { - string f = *it, dfile = basename (f) + ".d", line; + string f = *it, dfile = basename (f, true) + ".d", line; unlink (dfile.c_str ()); string cmd = vars["CC"] + " " + vars["DEPEND_FLAGS"] + " " @@ -640,7 +640,7 @@ for (it = f77files.begin (); it != f77files.end (); ++it) { - string f = *it, b = basename (f); + string f = *it, b = basename (f, true); if (!vars["F77"].empty ()) { string o; @@ -671,7 +671,7 @@ string f = *it; if (!vars["CC"].empty ()) { - string b = basename (f), o; + string b = basename (f, true), o; if (!outputfile.empty ()) { if (link) @@ -700,7 +700,7 @@ string f = *it; if (!vars["CXX"].empty ()) { - string b = basename (f), o; + string b = basename (f, true), o; if (!outputfile.empty ()) { if (link) diff -r 33537a4d223f -r f26a33e21db9 mkoctfile.in --- a/mkoctfile.in Thu Dec 10 01:28:26 2009 -0500 +++ b/mkoctfile.in Thu Dec 10 01:49:15 2009 -0500 @@ -405,16 +405,16 @@ for f in $f77files; do case $f in *.f) - b=`echo $f | $SED 's,\.f$,,'` + b=`echo $f | $SED 's,.*/,,; s,\.f$,,'` ;; *.F) - b=`echo $f | $SED 's,\.F$,,'` + b=`echo $f | $SED 's,.*/,,; s,\.F$,,'` ;; *.f90) - b=`echo $f | $SED 's,\.f90$,,'` + b=`echo $f | $SED 's,.*/,,; s,\.f90$,,'` ;; *.F90) - b=`echo $f | $SED 's,\.F90$,,'` + b=`echo $f | $SED 's,.*/,,; s,\.F90$,,'` ;; esac if [ -n "$F77" ]; then @@ -440,7 +440,7 @@ if [ -n "$cfiles" ]; then for f in $cfiles; do if [ -n "$CC" ]; then - b=`echo $f | $SED 's,\.c$,,'` + b=`echo $f | $SED 's,.*/,,; s,\.c$,,'` if [ -n "$outputfile" ]; then if $link; then o=$b.o @@ -465,13 +465,13 @@ if [ -n "$CXX" ]; then case $f in *.cc) - b=`echo $f | $SED 's,\.cc$,,'` + b=`echo $f | $SED 's,.*/,,; s,\.cc$,,'` ;; *.C) - b=`echo $f | $SED 's,\.C$,,'` + b=`echo $f | $SED 's,.*/,,; s,\.C$,,'` ;; *.cpp) - b=`echo $f | $SED 's,\.cpp$,,'` + b=`echo $f | $SED 's,.*/,,; s,\.cpp$,,'` ;; esac if [ -n "$outputfile" ]; then