[Omake] Compiling Ada code

Dirk Heinrichs dirk.heinrichs at online.de
Mon Nov 6 09:59:44 PST 2006


Am Montag, 6. November 2006 18:28 schrieb Aleksey Nogin:
> On 24.10.2006 10:46, Dirk Heinrichs wrote:
> > OK, I've put together a simple, (semi-) self learning build system using
> > omake. In it's current form it can build binaries and shared libs from
> > Ada and/or C/C++ source files, compiled with gcc/gnat.
>
> Dirk,
>
> How easy would it be to create a "generic" Ada.om similar is style to
> build definitions for other languages that are already included in
> OMake's standard library? If it's easy to create it, we would be happy
> to include it in the OMake distribution.

Hmm, don't know. I only took a quick look at C.om. However, since Ada files 
are compiled using gcc (at least when using gnat), I'd guess you get 80-90% 
by taking C.om, replacing the rules, functions and scanners as appropriate. 
The remainder is solving some ada (or gnat) specific issues like "specs 
without bodies" or subunits (there may be others I'm not yet aware of).

About the first one: Usually, Ada units consist of a specification and a body. 
The first one contains the interface of a unit, while the latter contains the 
implementation. In most cases, you tell the compiler to compile the body 
(*.adb) and the spec will be compiled automatically. However, there are cases 
when a body is not needed (the spec only defines variables and constants), so 
that one has to tell the compiler to compile this spec (*.ads).

To the second: Although spec and body belong together, the programmer can 
separate out parts of a body into other files, called sub units. The compiler 
will automatically compile the sub units along with the body, but the files 
must follow some naming convention and must be found in the compilers search 
path.

One thing I don't know is the Windows part. I know gnat is available for 
Windows, but that's really all I know :-)

Having said that, my offer is still valid to give you my small build system 
(which is also pretty generic, btw.) as a starting point. It currently 
compiles C/C++ and Ada code and create shared libs and executable programs 
from the resulting object files. It has a little perl program to find out Ada 
dependencies and correctly handles sub units and the spec only case. It can 
also find out wether an executable is built from Ada or C source and creates 
the correct linker rule (rules are created on the fly, btw.)

Adding support for other languages should also be easy, I'm planning to add 
LaTeX support soon.

Bye...

	Dirk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.metaprl.org/pipermail/omake/attachments/20061106/76d68086/attachment.bin


More information about the Omake mailing list