Version franaise
Home About Download Resources Contact us

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
ocamlbuild rules generating multiple files
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-02-10 (22:59)
From: Mikkel_Fahnøe_Jørgensen <mikkel@d...>
Subject: Re: [Caml-list] ocamlbuild rules generating multiple files
2009/2/10 Daniel Bünzli <>:
> Thanks but my problem is that the generated file do not have the same
> basename as the dep i.e. I cannot specify the ~prods arg, the ~prods are
> going to be discovered while the rule is executed and without going through
> further "build" argument invocations.

This is how dependency scanners also work.

You can see an example in

search for:

Here accumulated_include_rule is used instead of rule, but it calls
rule eventually, but with its calculated prod arguments that it gets
(in this case) from reading multiple dependency files. You could
modify this function to take a list of a .tgz file.

Some care needs to be taken since each build step must produce an
actual file - especially when creating dependencies, but it is not
necessarily required in you case. Dependency scanners do need to
produce files so something else can depend on this files to ensure the
dependency is scanned.