‑‑dependencies
Syntax
‑‑dependencies[=[i|m|n][s][l|w][b]] {filename|directory|+}Parameters
| Lists only the names of files |
| Lists in makefile style (multiple rules) |
| Lists in makefile style (one rule) |
| Suppresses system files |
| Uses the locale encoding instead of UTF-8 |
| Uses little-endian UTF-16 instead of UTF-8 |
| Uses a Byte Order Mark (BOM) in UTF-8 output |
| Gives the same output as |
See also Rules for specifying a filename or directory as parameters.
Description
Use this option to make the compiler list the names of all source and header files opened for input into a file with the default filename extension i.
Example
If ‑‑dependencies or ‑‑dependencies=i is used, the name of each opened input file, including the full path, if available, is output on a separate line. For example:
c:\iar\product\include\stdio.h d:\myproject\include\foo.h
If ‑‑dependencies=m is used, the output is in makefile style. For each input file, one line containing a makefile dependency rule is produced. Each line consists of the name of the object file, a colon, a space, and the name of an input file. For example:
foo.o: c:\iar\product\include\stdio.h foo.o: d:\myproject\include\foo.h
An example of using ‑‑dependencies with a popular make utility, such as GMake (GNU make):
Set up the rule for compiling files to be something like:
%.o : %.c $(ICC) $(ICCFLAGS) $< ‑‑dependencies=m $*.dThat is, in addition to producing an object file, the command also produces a dependency file in makefile style—in this example, using the extension
.d.Include all the dependency files in the makefile using, for example:
-include $(sources:.c=.d)
Because of the dash (
-) it works the first time, when the.dfiles do not yet exist.
Caution
This option is not available in the IDE.