delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/03/31/23:32:55

From: "Gordon Hogenson" <gordon AT yrd DOT chem DOT washington DOT edu>
Date: Thu, 31 Mar 1994 20:04:23 -0800
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: GCC -MM comments

Thus must have been discussed before, but I don't remember it.
I am having some trouble with gcc -MM to produce makefile depencies.
The problem seems to be with long command lines.

gcc -MM foo1.c foo2.c ..... foo_n.c > makefile.dep

gives the output "can't find file <-MM>" if the total line length
is more than 128 (or so).

This is not that much of a problem, as I can use

gcc -MM *.cc > makefile.dep

(although this did hang my system and required a reboot *once*,
it hasn't since then (?)).

Or I can use the response file method to accomplish the same thing.

A more interesting problem is what happens when I have an include
file that is located in an unusual directory.  In such cases, the
path and drive letter appear in the output:

foo.o : foo.cc E:/OTHER/INCLUDE

But make (gnu make 3.69) chokes on the colon.  The solution is to
escape the colon with a backslash, but this is painful if I have
a very large dependency file and don't happen to have 'sed' around.
In any case, gcc -MM should produce output that does not need to be
modified (IMHO).

Gordon J. Hogenson

ghogenso AT u DOT washington DOT edu


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019