Is there an equivalent to the gcc -MM command?
For those that haven't come across it, it produces a dependency list for the given file that you can then use in make.
I am aware of the --autobuild option but the source that I have inherited needs dependencies in the makefile itself due to having to calculate targets on the fly depending upon what data is supplied, There is no way around it :/
I can force a complete rebuild each time (which isnt too time consuming really) but I would rather know that stuff gets built when it is needed, just in case...
Thanks in advance, Bryan "Brain Murders" Meredith
Bryan Meredith wrote:
Is there an equivalent to the gcc -MM command?
For those that haven't come across it, it produces a dependency list for the given file that you can then use in make.
I am aware of the --autobuild option but the source that I have inherited needs dependencies in the makefile itself due to having to calculate targets on the fly depending upon what data is supplied, There is no way around it :/
`-MM' etc. may work for includes (as they do in C), but not for units and modules (since they're preprocessor options, and the preprocessor doesn't deal with them) which are usually the more interesting part.
Even the include part may stop being available with the new preprocessor (in one of the next releases probably).
The `gp' utility may provide some options like those you need in the future, but I don't know exactly yet, and it will be some time ...
So basically, your answer is no. For "well-behaved" code (such as, say, only units, all `uses' parts in one line, no preprocessor tricks that affect them, etc.), it's rather easy to write this yourself (using sed, Pascal code, whatever), but for the general case you need half a Pascal parser ...
I can force a complete rebuild each time (which isnt too time consuming really) but I would rather know that stuff gets built when it is needed, just in case...
You are aware of `--automake' (instead of `--autobuild'), are you? (It may do a bit too much sometimes, but far less than a complete rebuild in most cases.)
Frank