Hi,

I'm having difficulties understanding on which files I should declare tags: *.ml, or *.cmo/cmx?

For instance, with normal (non-parameterized) tags, declaring the tag
on the .cmo/.cmx seems to have no effect on the compilation, for
instance:

$ cat _tags
<*.cmo>: annot
<*.cmx>: annot
$ ocamlbuild -classic-display A.cmo A.cmx
/usr/pkg/bin/ocamldep.opt -modules A.ml > A.ml.depends
/usr/pkg/bin/ocamlc.opt -c -o A.cmo A.ml
/usr/pkg/bin/ocamlopt.opt -c -o A.cmx A.ml

Here, tagging *.cmo/cmx has no effect.  The _build/_log says:

# Target: A.cmo, tags: { byte, compile, extension:ml, file:A.ml, implem, ocaml, quiet, traverse }

The tag annot is not there.  But if *.ml is used instead of *.cmo in
_tags, then the tag appears in the above target.  Does this mean that
tags to customize compilation commands should be declared on the *.ml
files?  (Hence they necessarily apply to both .cmo and .cmx files?)

The situation looks a bit different with parameterized tags, for
instance :

$ cat _tags
<*.cmo>: pp(foo)
<*.cmx>: pp(foo)
$ ocamlbuild -classic-display A.cmo A.cmx
/usr/pkg/bin/ocamldep.opt -modules A.ml > A.ml.depends
/usr/pkg/bin/ocamlc.opt -c -o A.cmo A.ml
/usr/pkg/bin/ocamlopt.opt -c -pp foo -o A.cmx A.ml

Here, the pp(foo) tag is ignored for the *.cmo declaration, but it is
used for the *.cmx declaration.  Is this behavior intended?  The code
says (ocaml_specific.ml):

pflag ["ocaml"; "compile"] "pp"
    (fun param -> S [A "-pp"; A param]);

So I wonder why pp(foo) only applies to *.cmx.

Thanks for your help,

Grégoire

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to