Version française
Home     About     Download     Resources     Contact us    
Browse thread
OCamlBuild question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Teller <David.Teller@u...>
Subject: OCamlBuild question
	Hi everyone,
I'm trying to write a OCamlBuild plug-in to automatically generate
the .mli corresponding to a .mlpack (for documentation purposes).

I've written a [rule] which lets me depend a .mli on the
corresponding .mlpack .  From this .mlpack, I can obtain the list of
modules involved in the construction of the pack. Now, I only have to
1. find the corresponding source .mli files
2. find the corresponding .mli.depends files
3. do a topological sort and create the destination .mli .

Part 3 is no problem. On the other hand, I haven't been able to progress
much with parts 1 and 2. 

Part 2 requires waiting until the corresponding .mli.depends have been
created, but 
* neither [~insert:`bottom] nor [~insert:(`after foo)] seem to help here
* attempting to [build] an ad-hoc list of files somehow extracted from
the mlpack only gives me dependency errors
* attempting [Solve.solve_target] doesn't seem to help any further.

As for part 1, it requires the ability to find which source .ml / .mli
correspond to a given module. I can only assume OCamlBuild offers some
kind of API for this purpose, because I'd rather avoid folding through
the whole tree, resolving [include] directives myself to find a .ml or
a .mli which may be the right file.

Does anyone have suggestions?

Thanks,
 David
-- 
David Teller-Rajchenbach
 Security of Distributed Systems
  http://www.univ-orleans.fr/lifo/Members/David.Teller
 Angry researcher: French Universities need reforms, but the LRU act brings liquidations.