Skip to main content

IAR Embedded Workbench for RL78 5.20

‑‑dependencies

In this section:
Syntax
‑‑dependencies[=[i|m|n][s][l|w][b]] {filename|directory|+}
Parameters

i (default)

Lists only the names of files

m

Lists in makefile style (multiple rules)

n

Lists in makefile style (one rule)

s

Suppresses system files

l

Uses the locale encoding instead of UTF-8

w

Uses little-endian UTF-16 instead of UTF-8

b

Uses a Byte Order Mark (BOM) in UTF-8 output

+

Gives the same output as -o, but with the filename extension d

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):

  1. Set up the rule for compiling files to be something like:

         %.o : %.c
               $(ICC) $(ICCFLAGS) $< ‑‑dependencies=m $*.d

    That 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.

  2. 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 .d files do not yet exist.

Caution

This option is not available in the IDE.