Version franaise
Home About Download Resources Contact us
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: -- (:)
From: Mikkel_Fahnøe_Jørgensen <mikkel@d...>
Subject: Re: [Caml-list] ocamlbuild rules generating multiple files
2009/2/10 Daniel Bünzli <daniel.buenzli@erratique.ch>:
> 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

http://git.dvide.com/pub/ocamlbuild-ctools/tree/myocamlbuild_config.ml

search for:
accumulated_include_rule

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.

Mikkel