Creates an output file that contains targets suitable for inclusion in a description file for the make command to describe the dependencies of the main source file in the compilation. If gcc suboption is specified, the description file includes a single target listing all dependencies, otherwise there is a separate rule for each dependency in the description file.


Read syntax diagramSkip visual syntax diagram>>- -q--makedep--+--------+------------------------------------><

Where gcc controls the format of the generated make rule to match GNU C/C++ format.


If you specify an invalid suboption , a warning message will be issued and the option is ignored.

Specifying -qmakedep without any suboption is functionally equivalent to specifying -M 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.

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

xlc++ -qmakedep 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++ -qmakedep 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 -qmakedep, the .u file is placed in the directory implied by -ofile_name. For example, for the following invocation:

xlc++ -qmakedep -c t.C -o /tmp/t.o

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

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


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.

Related information