This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: question about gcc/g++ -M option
- From: John Love-Jensen <eljay at adobe dot com>
- To: Lin George <george4academic at yahoo dot com>, MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Thu, 27 Apr 2006 07:17:40 -0500
- Subject: Re: question about gcc/g++ -M option
Hi George,
> What is the function of gcc/g++ -M option? I have read
> through the man page but still can not understand.
> Could anyone show me an example please?
The -M option is used to create a dependency directed acyclic graph. It is
in Makefile depedency format output of file prerequisites.
To see how that is used in conjunction with Makefiles, look here:
http://www.gnu.org/software/make/manual/html_node/Automatic-Prerequisites.ht
ml
If you don't use Makefiles, for example if you are using Xcode projects, or
if you use certain alternative make systems such as AT&T Nmake, or you
ascertain dependencies using a truss-like mechanism, then you needn't bother
with -M.
HTH,
--Eljay