[Omake] Compiling Ada code
Aleksey Nogin
nogin at metaprl.org
Tue Nov 7 09:34:10 PST 2006
On 06.11.2006 14:00, Dirk Heinrichs wrote:
>> Note that OMake standard library already comes with LaTeX support (see
>> the LaTeX.om file or the LaTeX section of the documentation -
>> http://omake.metaprl.org/omake-doc.html#htoc438 )
>
> I'll take a look at it.
>
> But I'd guess our approaches are too different:
>
> You have portability in mind, I don't care about Windows.
Yes, although with OMake the portability is usually fairly cheap. In
many cases we do not care too much about portability, but writing things
portably does not "cost" us much, and so we do it anyway.
> You require that users list which source files go into which lib/executable, I
> determine this by directory structure.
In some cases this is just a historical artifact. For things like
LaTeXDocument, it is sufficient to supply only the name of the "main"
document, and the scanner will figure out the rest. The ability to
specify the full list of source files came from the time that we did not
have a good scanner for LaTeX. But for most other languages, the list of
modules to compile in needs to be passed in by the developer (even for
languages like OCaml where it might be theoretically possible to find
out the "minimal" set of modules that need to be linked in, the
"minimal" set is often not the right one). It might be possible to
supplement our "low-level" functions (that expect the full list of
modules) with "high-level" ones (that compute the list themselves), but
completely hiding the low-level functions would probably be a bad idea.
For Ada, it would probably be best to provide the low-level functions of
out "traditional" style, taking a "manual" list of modules and possibly
some high-level functions that compute the list automatically (and then
just call the appropriate low-level function).
> You put object files into the source dir, I place them elsewhere.
> ...
This is a more "interesting" difference. In general, we address this in
two ways:
- have an "Install" function that copies (or symlinks) the executables
to another location
- invite people to use the vmount function (which, admittedly, has
problems of its own, especially with some broken dependency checkers).
> I have assembled a little tarball with this build system and some Ada sample
> code. It's 18k in size, can I send it to the list or should I upload it
> somewhere?
Sending to list is fine. Alternatively, you can create a "Add support
for Ada" entry in Bugzilla (http://bugzilla.metaprl.org/ ) and add it as
an attachment there.
Aleksey
P.S. On the subject of perl script vs OMake script - one advantage of
the OMake script that I forgot to mention is that in a perl script the
best you can do is to test whether a certain file exists, while in OMake
you can tests whether that file is _buildable_. The latter enables you
to generate correct dependencies when some source files are supposed to
be generated and have not been generated yet. See the ocamldep-postproc
function in OCaml.om on 0.9.8.x branch for an example.
More information about the Omake
mailing list