-M

Description

Creates an output file that contains targets suitable for inclusion in a description file for the make command.

Syntax

Read syntax diagramSkip visual syntax diagram>>- -M---------------------------------------------------------><

Notes

The -M option is functionally identical to the -qmakedep option.

.u files are not make files; .u files must be edited before they can be used with the make command. For more information on this command, see your operating system documentation.

The output file contains a line for the input file and an entry for each include file. It has the general form:

file_name.o:file_name.c
file_name.o:include_file_name

Include files are listed according to the search order rules for the #include preprocessor directive, described in Directory search sequence for include files using relative path names. If the include file is not found, it is not added to the .u file.

Files with no include statements produce output files containing one line that lists only the input file name.

Examples

If you do not specify the -o option, the output file generated by the -M option is created in the current directory. It has a .u suffix. For example, the command:

xlc -M person_years.c

produces the output file person_years.u.

A .u file is created for every input file with a .c, .C, .cpp, or .i suffix. Also, when compiling C++ programs with the -+ compiler option in effect, any file suffix is accepted and a .u file produced. Otherwise, output .u files are not created for any other files.

For example, the command:

xlc -M conversion.c filter.c /lib/libm.a

produces two output files, conversion.u and filter.u, and an executable file as well. No .u file is created for the library.

If the current directory is not writable, no .u file is created. If you specify -o file_name along with -M, the .u file is placed in the directory implied by -o file_name. For example, for the following invocation:

xlc -M -c t.c -o /tmp/t.o

places the .u output file in /tmp/t.u.

Related information