Sun Studio 12: C++ User's Guide

A.2.140 –xM

Runs only the C++ preprocessor on the named C++ programs, requesting that the preprocessor generate makefile dependencies and send the result to the standard output (see make(1) for details about make files and dependencies).

A.2.140.1 Examples

For example:


#include <unistd.h>
void main(void)
{}

generates this output:


e.o: e.c
e.o: /usr/include/unistd.h
e.o: /usr/include/sys/types.h
e.o: /usr/include/sys/machtypes.h
e.o: /usr/include/sys/select.h
e.o: /usr/include/sys/time.h
e.o: /usr/include/sys/types.h
e.o: /usr/include/sys/time.h
e.o: /usr/include/sys/unistd.h

Interactions

If you specify -xM and -xMF, the compiler writes all makefile dependency information to the file specified with -xMF. This file is overwritten each time the preprocessor writes to it.

See also

make(1S) (for details about makefiles and dependencies)