From octave-maintainers-request at bevo dot che dot wisc dot edu Fri Nov 3 20:28:19 2000 Subject: mkoctfile suggestion From: Andy Adler To: octave-maintainers at bevo dot che dot wisc dot edu Date: Fri, 3 Nov 2000 21:29:23 -0500 (EST) I suggest that the -c option be added to mkoctfile. This would have the same effect as with gcc, ie to compile to object but not link: So, for example, you could do An:~/octave/sparse> mkoctfile -c make_sparse.cc -ISuperLU/SRC/ An:~/octave/sparse> mkoctfile make_sparse.o -lsuperlu -L. This would allow it to be nicely used in Makefiles, so that large projects with multiple source files don't need to be recompiled from scratch each time. _______________________________________ Andy Adler, en254 at ncf dot ca Patch against 2.1.31 --- mkoctfile.orig Fri Nov 3 20:57:41 2000 +++ mkoctfile Fri Nov 3 21:02:04 2000 at @ -48,6 +48,7 @@ ldflags= dbg=: strip=false +link=true if [ $# -eq 0 ]; then echo $usage_msg at @ -88,6 +89,7 @@ -lLIB Add library LIB to link command. -LDIR Add -LDIR to link command. -o FILE, --output FILE Output file name. Default extension is .oct. + -c Compile, but do not link -s, --strip Strip output file. -v, --verbose Echo commands as they are executed. at @ -124,6 +126,9 @@ -s | --strip) strip=true ;; + -c) + link=false + ;; *) echo "mkoctfile: unrecognized argument $1" exit 1 at @ -202,14 +207,16 @@ # Link all the object files. -$dbg $SH_LD $SH_LDFLAGS -o $octfile $objfiles $ldflags -eval $SH_LD $SH_LDFLAGS -o $octfile $objfiles $ldflags +if $link; then + $dbg $SH_LD $SH_LDFLAGS -o $octfile $objfiles $ldflags + eval $SH_LD $SH_LDFLAGS -o $octfile $objfiles $ldflags # Maybe strip it. if $strip; then $dbg strip $octfile eval strip $octfile +fi fi exit 0