Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!arkesden.eng.sun.com!tiemann From: tiemann@arkesden.eng.sun.com (Michael Tiemann) Newsgroups: gnu.g++.bug Subject: [generating dependencies] Message-ID: <8911302359.AA06609@arkesden.sun.com> Date: 30 Nov 89 23:59:56 GMT References: <8911301950.AA17298@lurch.Stanford.EDU> Sender: daemon@tut.cis.ohio-state.edu Reply-To: tiemann@sun.com Distribution: gnu Organization: GNUs Not Usenet Lines: 32 The command g++ -M foo1.c foo2.cc foo3.C will give: foo1.o: ... foo2.o: ... foo3.C.o: ... This code in cccp.c supplies the make targets for g++ -M: /* Output P, but remove known suffixes. */ len = strlen (p); if (p[len - 2] == '.' && p[len - 1] == 'c') deps_output (p, len - 2); else if (p[len - 3] == '.' && p[len - 2] == 'c' && p[len - 1] == 'c') deps_output (p, len - 3); else deps_output (p, 0); /* Supply our own suffix. */ deps_output (".o : ", 0); deps_output (in_fname, 0); deps_output (" ", 0); Obviously .C is not a "known suffix". .cc has the advantage over .C that it can be used under systems which are not case-sensitive. Michael