From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 0025EBBAF for ; Wed, 30 Jun 2010 16:47:13 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhwFAA71KkyT0giP/2dsb2JhbACTJYw2ccByhSUEiCM X-IronPort-AV: E=Sophos;i="4.53,513,1272837600"; d="scan'208";a="65629837" Received: from iona.labri.fr ([147.210.8.143]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 30 Jun 2010 16:47:13 +0200 Received: from localhost (localhost.localdomain [127.0.0.1]) by iona.labri.fr (Postfix) with ESMTP id 4AC1536B85 for ; Wed, 30 Jun 2010 16:47:11 +0200 (CEST) X-Virus-Scanned: amavisd-new at labri.fr Received: from iona.labri.fr ([127.0.0.1]) by localhost (iona.labri.fr [127.0.0.1]) (amavisd-new, port 10027) with LMTP id jSFiQda+F7oQ for ; Wed, 30 Jun 2010 16:47:11 +0200 (CEST) Received: from [147.210.129.4] (laptop-147-210-129-4.labri.fr [147.210.129.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by iona.labri.fr (Postfix) with ESMTP id 2C0E536B83 for ; Wed, 30 Jun 2010 16:47:11 +0200 (CEST) Message-ID: <4C2B58EE.6090603@labri.fr> Date: Wed, 30 Jun 2010 16:47:10 +0200 From: =?ISO-8859-1?Q?Gr=E9goire_Sutre?= Organization: CNRS / LaBRI User-Agent: Mozilla/5.0 (X11; U; NetBSD i386; en-US; rv:1.9.1.9) Gecko/20100603 Shredder/3.0.4 MIME-Version: 1.0 To: caml-list@inria.fr Subject: ocamlbuild - which source files for tag declarations? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; gregoire:01 gregoire:01 cmo:01 cmx:01 cmo:01 cmx:01 compilation:01 usr:01 ocamldep:01 usr:01 ocamlc:01 ocamlopt:01 byte:01 ocaml:01 compilation:01 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