[Omake] Compiling Ada code
Aleksey Nogin
nogin at metaprl.org
Fri Oct 20 09:34:51 PDT 2006
On 20.10.2006 00:01, Dirk Heinrichs wrote:
> Ada packages usually consist of a specification (spec) and a body. The spec
> defines the interface to a package while the body implements the package.
> Both need to be compiled before they can be used. When a body is compiled,
> the spec is compiled automatically. This means, that when the spec changes
> the package body and all clients of the package need to be recompiled.
> OTOH, if only the body changes, one only needs to relink.
Do you have to compile a spec before compiling all the packages that
depend on it? Would it be possible to write a custom dependency scanner?
Note that OMake provides significant facilities for defining custom
lexers and parsers - we even have a C parser written in OMake - see the
lib/parse/C directory in the 0.9.8.x development branch.
> No. I'm saying that you only can find out what are the build prerequisites
> _after_ a file has been compiled.
Well, if you do not know what they are in advance, how do you know to
build them in advance? Or is this one of those environments where asking
to compile a single file would result in many files being compiled?
Having OMake rules that may (as a side-effect) compile an unpredictable
set of source files in one invocation is usually a bad idea. To get a
truly stable build environment you need to tell OMake about _all_ the
side-effects of each rule. For example, what happens if you run "omake
-j2" and it happens to start two instances of such a tool on two modules
and they try to build the same source file at the same time?
BTW, can't you use the -gnatu option of gnatgcc (perhaps in conjunction
with -gnats or whatever is needed to tell it not to try actually
compiling) to get the list of units? If that workd, then you just need
to pipe it to a postprocessing function (take a look at the experimental
ocamldep-postproc in OCaml.om on 0.9.8.x branch for an example of such
function) to map those units to actual files in your include path (or
whatever the Ada equivalent is).
Aleksey
More information about the Omake
mailing list