This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Equivalent to gcc -M to build a list of *objects*
- From: Matthieu Moy <Matthieu dot Moy at imag dot fr>
- To: gcc-help at gnu dot org
- Date: Mon, 12 May 2003 21:25:57 +0200
- Subject: Equivalent to gcc -M to build a list of *objects*
- Organization: Verimag, STMicroelectronics
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