Next: Search Path Related Attributes, Previous: Config File Related Attributes, Up: Package Compiler [Contents][Index]
There are two dependency-related attributes: Dependency_Switches
and
Dependency_Driver
. If neither of these two attributes are specified for
a language other than Ada, then the source needs to be (re)compiled if
the object file does not exist or the source file is more recent than
the object file or the switch file.
For languages other than Ada, attribute Dependency_Switches
specifies
the option or options to add to the compiler invocation so that it creates
the dependency file at the same time. The value of attribute Dependency_Option
is a string list. The name of the dependency file is added to the last string
in the list, which may be empty. Example:
for Dependency_Switches ("C") use ("-Wp,-MD,");
With these Dependency_Switches
, when compiling file.c the compiler will be
invoked with the option -Wp,-MD,file.d.
Specifies the command and options to create a dependency file for a source. The full path name of the source is appended to the last string of the string list value. Example:
for Dependency_Driver ("C") use ("gcc", "-E", "-Wp,-M", "");
Usually, attributes Dependency_Switches
and Dependency_Driver
are not both
specified.