Equivalent to gcc -M to build a list of *objects*

Nick Patavalis npat@inaccessnetworks.com
Mon May 12 23:09:00 GMT 2003


On Tue, May 13, 2003 at 12:24:35AM +0200, Matthieu Moy wrote:
> 
> But in the following case, it doesn't :
> 
> file3.h  file2.h file1.h
>    |   \   |   \  |       
>    |    \  |    \ |       
> file3.c file2.c  file1.c   
>                  main()
> 
> because file1.c doesn't include either directly or indirectly file3.h,
> but file2.c will contain references to symbols defined in file3.o.
> 

Oh, I see. I don't think there is any tool that does what you want,
though I guess you could do it with some serious scripting. Anyway
this assumption that there is a *strict* one-to-one corespondence
between .c and .h files is almost never true in the C world.

Why don't you put all the .o files in an archive (library) and let the
linker decide what it needs and what not?

/npat

-- 
Perilous to us all are the devices of an art deeper than we possess 
ourselves.
  -- Gandalf, in J.R.R. Tolkien's The Lord of the Rings



More information about the Gcc-help mailing list