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]

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


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