This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Hi ! 

I have  a project  with many  files, and several  files have  a main()
function. (corresponding to different executables)

I'd like  to generate  the list  of objects to  be linked  together to
build each  executable, assuming  that any function  declared in  a .h
file is implemented in the corresponding .c file (or .hh and .cc). 

I've tried to use "gcc -M" on each file having a main function, and to
use  something   like  sed  's/\.[ch]$/.o/',  but   this  follows  the
#include in the .h files. If  I have some dependencies only in some .c
files, then, the list of objects is incomplete. 

Is there an option to pass to  GCC to accomplish this task ? Are there
some utilities doing this ? Do I have to do it myself ?

Thanks,

-- 
Matthieu


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]