AutoGen - The Automated Program Generator: 5.11 make-dep option (-M)

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 5.11 make-dep option (-M)

This is the “emit make dependency file” option.

This option has some usage constraints. It:

- may appear an unlimited number of times.
- may not be preset with environment variables or in initialization (rc) files.

This option behaves fairly closely to the way the `-M` series of options work with the gcc compiler, except that instead of emitting the predecessor dependencies, this emits both the predecessor and the successor dependencies (output files). By default, the output dependency information will be placed in `<base-name>.d`, but may also be specified with `-MF<file>`. The target will be the dependency file name, but may also be overridden with `-MT<targ-name>`. That is not, however, recommended. AutoGen will set the time stamp correctly on the dependency file, but it will not mess with this specified target.

NOTE: these second letters are part of the option argument, so `-MF <file>` must have the space character quoted or omitted, and `-M "F <file>"` is acceptable because the `F` is part of the option argument.

`-M` may be followed by any of the letters M, F, P, T, Q, D, or G. They are not all meaningful and one has a somewhat different meaning: `-MT<name>` This is interpreted as meaning `<name>` is a sentinel file that will depend on all inputs (templates and definition files) and all the output files will depend on this sentinel file.

This is the recommended usage:

    -MFwhatever-you-like.dep

and then in your `Makefile`, make the ‘`autogen`’ rule:

    whatever-you-like.dep:
        autogen -MF$@ .....

The modification time on the dependency file is adjusted to be one second before the earliest time stamp of any other output file. Consequently, it is suitable for use as the sentinel file testifying to the fact the program was successfully run.

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

This document was generated by Bruce Korb on July 25, 2010 using texi2html 1.82.