Adriaan van Os (Microbizz) wrote:
Chapter 12.10 of the GPC docs "GPCÂs Automake Mechanism  How it Works" reads as follows:
"When a program/module/unit imports (uses) an interface, GPC searches for the GPI file (see Section 12.9 [GPI files], page 476) derived from the name of the interface.
Case 1: A GPI file was found.
Each GPI file contains the name of the primary source file (normally a Â.pas or Â.p file) of the module/unit, and the names of all interfaces imported. GPC reads this information and invokes itself with a command like gpc foo.pas -M -o foo.d This means: preprocess the file, and write down the name of the object file and those of all its source files in Âfoo.dÂ. GPC reads Âfoo.d and looks if the object file exists and if the source was modified since the creation of the object file and the gpi file. If so, GPC calls itself again to compile the primary source file. When everything is done, the Â.d file is removed. If there was no need to recompile, all interfaces imported by the module/unit are processed in the same way as this one."
I may be doing something wrong but "gpc foo.pas -M -o foo.d" doesn't give the primary source file nor the names of all interfaces imported, instead the '.d' file is always empty ....
It gives the names of included files (note: preprocessor).
Any clues or hints ? Full information on all unit dependencies is crucial in the project I am working on (an IDE plugin for GPC).
That's currently not easy to obtain unless you parse the files yourself. The `gp' utility will provide such information (`--print-sources', though it doesn't help you right now ...).
Frank