2.1.79. -M

This option instructs the compiler to produce a list of make file dependency lines suitable for use by a make utility.

The compiler executes only the preprocessor step of the compilation. By default, output is on the standard output stream.

If you specify multiple source files, a single dependency file is created.

If you specify the -o filename option, the dependency lines generated on standard output make reference to filename.o, and not to source.o. However, no object file is produced with the combination of -M -o filename.

Use the --md option to generate dependency lines and object files for each source file.

Example

You can redirect output to a file by using standard UNIX and MS-DOS notation, for example:

armcc -M source.c > Makefile

See also

Copyright © 2007, 2010 ARM Limited. All rights reserved.ARM DUI 0348A
Non-Confidential