makedepend for C++?

makedepend for C++?

Post by Timothy Jon » Tue, 27 Nov 1990 08:00:13



Does anyone know if there's a version of makedepend(1) for UNIX that knows how
to deal with C++?

Thanks,
Tim
--

Department of Computer Science             ...!rutgers!columbia!cs!tim (usenet)

 
 
 

makedepend for C++?

Post by David S. Masters » Fri, 30 Nov 1990 05:07:10


Timothy> Does anyone know if there's a version of makedepend(1) for UNIX that
Timothy> knows how to deal with C++?

Why won't the one that deals with C work (its just a search for #include in
both cases, isn't it)?
--
====================================================================
David Masterson                                 Consilium, Inc.
(415) 691-6311                                  640 Clyde Ct.
uunet!cimshop!davidm                            Mtn. View, CA  94043
====================================================================
"If someone thinks they know what I said, then I didn't say it!"

 
 
 

makedepend for C++?

Post by Marco S Hym » Sat, 01 Dec 1990 14:43:49


    Does anyone know if there's a version of makedepend(1) for UNIX that
    knows how to deal with C++?

Don't know if this is close to makedepend(1) (it's not on any machine that I
use) but this script works fine for me.

#! /bin/sh

#
# Make C++ dependencies.  This script depends upon the -H option built
# into cpp in System V unix.  Note: some CC shell scripts do not process
# -H properly, i.e. they do not pass it to cpp.  If this happens you will
# see an error message from patch or munch.  If this happens edit your CC
# script to pass -H to cpp.
#
# BSD users can try the -M option to cpp and then modify the script to parse
# -M output.  The Sun cpp will process the -H option and the script might
# work as is.

CC=${CC-CC}     # use CC unless ${CC} set in environment

# process all files on the command line.  Abort if no files passed

if [ "$1" = "" ]; then
        exit 1
fi

for file do
        ${CC} -E -H $file 2>&1 >/dev/null |
        grep '^\./' |
        sed "s;^\./;$file: ;"
done |
sort |
uniq |
sed 's/\(.*\)\.cc: \(.*\)/\1.o: \2/' |
awk ' { if ($1 != prev) {
             print rec;
             rec = $0;
             prev = $1
           } else {
             if (length(rec $2) > 72) {
               print rec;
               rec = $0
             } else {
               rec = rec " " $2
             }
           }
         }
        END { print rec } '

// marc
--

// {ames,decwrl,sun}!pacbell!dumbcat!marc

 
 
 

makedepend for C++?

Post by Timothy Jon » Sat, 01 Dec 1990 19:17:37


   Timothy> Does anyone know if there's a version of makedepend(1) for UNIX that
   Timothy> knows how to deal with C++?

   Why won't the one that deals with C work (its just a search for #include in
   both cases, isn't it)?

Specifically, I'm using g++, and the problem is that I get lots of
'unknown directive == "#elif defined..."' error messages, presumably
caused by included files within my source file.  Perhaps I just have an
old version of makedepend which doesn't understand "elif" for some
reason.

Running g++ -M does the trick, but I can't use it to parse other source
language files, like lex or yacc.  I guess I can use the regular
makedepend for that and combine the results of the two programs
(sigh)...

Tim

 
 
 

1. makedepends and C++

I'm using makedepends on RH 7.0 anc g++.

When I run it, may makefile shows dependencies that look like this:

file.c.o : xxxxx

Why does it put the .c in there ?

Are there any specific options that I need to specify when using C++ source
?

thanks.

2. Burning Solaris Readable CDs from Windows

3. makedepend for AIX?

4. hi

5. need help on imake and makedepend

6. pts m zik:ns

7. makedepend and standard headers

8. can't access sunsite mirrors?

9. need help with makedepend

10. STUPID QUESTION: where is redhat makedepend package?

11. makedepend

12. makedepend looks for includes in the wrong place!

13. Alternative for makedepend ?