Mercurial > hg > octave-avbm
changeset 3846:08cd791cd613
[project @ 2001-07-27 18:19:48 by jwe]
author | jwe |
---|---|
date | Fri, 27 Jul 2001 18:19:49 +0000 |
parents | d68c34dc9c25 |
children | 92fb162eba24 |
files | ChangeLog Makeconf.in mkoctfile.in |
diffstat | 3 files changed, 62 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2001-07-27 John W. Eaton <jwe@bevo.che.wisc.edu> + + * Makeconf.in (do-subst-config-vals): Substitute DEPEND_FLAGS and + DEPEND_EXTRA_SED_PATTERN. + * mkoctfile.in: Handle --depend. + 2001-07-25 Rafael Laboissiere <rafael@laboissiere.net> * octave-config.in: New file.
--- a/Makeconf.in +++ b/Makeconf.in @@ -358,6 +358,8 @@ -e "s;%OCTAVE_CONF_CXXPICFLAG%;\"${CXXPICFLAG}\";" \ -e "s;%OCTAVE_CONF_CXX_VERSION%;\"${CXX_VERSION}\";" \ -e "s;%OCTAVE_CONF_DEFAULT_PAGER%;\"${DEFAULT_PAGER}\";" \ + -e "s;%OCTAVE_CONF_DEPEND_FLAGS%;\"${DEPEND_FLAGS}\";" \ + -e "s;%OCTAVE_CONF_DEPEND_EXTRA_SED_PATTERN%;\"${DEPEND_EXTRA_SED_PATTERN}\";" \ -e "s;%OCTAVE_CONF_DLFCN_INCFLAGS%;\"${DLFCN_INCFLAGS}\";" \ -e "s;%OCTAVE_CONF_EXE%;\"${EXE}\";" \ -e "s;%OCTAVE_CONF_F2C%;\"${F2C}\";" \
--- a/mkoctfile.in +++ b/mkoctfile.in @@ -24,6 +24,9 @@ : ${XTRA_CFLAGS=%OCTAVE_CONF_XTRA_CFLAGS%} : ${XTRA_CXXFLAGS=%OCTAVE_CONF_XTRA_CXXFLAGS%} +: ${DEPEND_FLAGS=%OCTAVE_CONF_DEPEND_FLAGS%} +: ${DEPEND_EXTRA_SED_PATTERN=%OCTAVE_CONF_DEPEND_EXTRA_SED_PATTERN%} + : ${SH_LD=%OCTAVE_CONF_SH_LD%} : ${SH_LDFLAGS=%OCTAVE_CONF_SH_LDFLAGS%} @@ -49,10 +52,12 @@ dbg=: strip=false link=true +depend=false +compile=true if [ $# -eq 0 ]; then echo $usage_msg - exit 1; + exit 1 fi while [ $# -gt 0 ]; do @@ -93,6 +98,9 @@ -LDIR Add -LDIR to link command. + -M, --depend Generate dependency files (.d) for C and C++ + source files. + -c Compile, but do not link. -o FILE, --output FILE Output file name. Default extension is .oct. @@ -135,6 +143,10 @@ -[lL]*) ldflags="$ldflags $1" ;; + -M | --depend) + depend=true + compile=false + ;; -o | --output) shift if [ $# -gt 0 ]; then @@ -172,6 +184,47 @@ shift done +# Generate dependency files for C and C++ files. + +if $depend; then + if [ -n "$cfiles" ]; then + for f in $cfiles; do + b=`echo $f | sed 's,\.c$,,'` + d=$b.d + + $dbg rm -f $d + eval rm -f $d + cmd="$CC $DEPEND_FLAGS $CPPFLAGS $ALL_CFLAGS $f | sed $DEPEND_EXTRA_SED_PATTERN -e 's,^[^:]*/\(.*\.o\):,\1:,' -e 's,$b\.o,pic/& & $d,g' > $d-t && mv $d-t $d" + $dbg $cmd + eval $cmd + done + fi + + if [ -n "$ccfiles" ]; then + for f in $ccfiles; do + case $f in + *.cc) + b=`echo $f | sed 's,\.cc$,,'` + ;; + *.C) + b=`echo $f | sed 's,\.C$,,'` + ;; + *.cpp) + b=`echo $f | sed 's,\.cpp$,,'` + ;; + esac + d=$b.d + $dbg rm -f $d + eval rm -f $d + cmd="$CXX $DEPEND_FLAGS $CPPFLAGS $ALL_CXXFLAGS $f | sed $DEPEND_EXTRA_SED_PATTERN -e 's,^[^:]*/\(.*\.o\):,\1:,' -e 's,$b\.o,pic/& & $d,g' > $d-t && mv $d-t $d" + $dbg $cmd + eval $cmd + done + fi + # If generating dependencies, that's all we do. + exit 0 +fi + # Compile Fortran, C, and C++ files. Add the name of each object file # that is produced to the overall list of object files.