octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mkoctfile suggestion


From: Andy Adler
Subject: mkoctfile suggestion
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,                address@hidden

Patch against 2.1.31

--- mkoctfile.orig      Fri Nov  3 20:57:41 2000
+++ mkoctfile   Fri Nov  3 21:02:04 2000
@@ -48,6 +48,7 @@
 ldflags=
 dbg=:
 strip=false
+link=true
 
 if [ $# -eq 0 ]; then
   echo $usage_msg
@@ -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.
 
@@ -124,6 +126,9 @@
     -s | --strip)
       strip=true
     ;;
+    -c)
+      link=false
+    ;;
     *)
       echo "mkoctfile: unrecognized argument $1"
       exit 1
@@ -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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]