From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 8820A7EEBF for ; Sun, 2 Aug 2015 22:32:40 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.213.173; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.213.173 as permitted sender) identity=mailfrom; client-ip=209.85.213.173; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ig0-f173.google.com) identity=helo; client-ip=209.85.213.173; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-ig0-f173.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AXBwASfr5VlK3VVdFbGQEBAYMdNWkGgx2hY5lRhXMKAoEXB0wBAQEBAQESAQEBAQcLCwkfMIQkAQEBAxIRBBkBGx0BAwwGBQsNAgImAgIhAQERAQUBHAYTIod2AQMSpA+BLj4xiz+BbIJ5ilwKGScNV4RaAQEBAQYBAQEBGAEFDoEUii2CT4I5B4JpgUMBBIcXhmCHAoR7ZoUAgWuBR0aQDAqFWRIjgRcXgk6BQDwxgkwBAQE X-IPAS-Result: A0AXBwASfr5VlK3VVdFbGQEBAYMdNWkGgx2hY5lRhXMKAoEXB0wBAQEBAQESAQEBAQcLCwkfMIQkAQEBAxIRBBkBGx0BAwwGBQsNAgImAgIhAQERAQUBHAYTIod2AQMSpA+BLj4xiz+BbIJ5ilwKGScNV4RaAQEBAQYBAQEBGAEFDoEUii2CT4I5B4JpgUMBBIcXhmCHAoR7ZoUAgWuBR0aQDAqFWRIjgRcXgk6BQDwxgkwBAQE X-IronPort-AV: E=Sophos;i="5.15,596,1432591200"; d="scan'208";a="141841005" Received: from mail-ig0-f173.google.com ([209.85.213.173]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 02 Aug 2015 22:32:28 +0200 Received: by igk11 with SMTP id 11so60588216igk.1 for ; Sun, 02 Aug 2015 13:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=VihiMss1l6s+jOuJcikF8dcmkRGGCml669HJ1GpciC4=; b=j9YVoqyqAiDNqyXJqwfVZdm86bSuYfw3v6S2ORqnz58WaDm8PnvG04S9ot3w2wBD74 Gy8nvwNQ5DdVRQHx7eL6B/n3O62DrEgQyZqcIX8+yuIXZ7zI06l6jJqN9BIplYSbumDj 3gXHIouq0vXXRXNQ1RiVS9sDhEfiraX/7DWtOLmdgm7QUvSxJkMVn2Lokm4/uiANMHh6 mvhBEWv+HHeZ4Ie/2Hf5rc9+O7iEdxgf/zu0Z/gDK2vDwd9/v5/Qe+/W/1QNgFsnGg4d xRUqDi1eHEk3dumkuW19BVrsqNVw4dtxx1sNSdBzhUawADe+XEmaTUyuUZRf3CPYhqbf gfHQ== X-Received: by 10.50.138.76 with SMTP id qo12mr18367734igb.38.1438547547185; Sun, 02 Aug 2015 13:32:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.68.132 with HTTP; Sun, 2 Aug 2015 13:31:47 -0700 (PDT) In-Reply-To: References: From: Gabriel Scherer Date: Sun, 2 Aug 2015 22:31:47 +0200 Message-ID: To: Jordan W Cc: "caml-list@inria.fr" Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] A way to have certain file suffixes treated as .ml/.mli with ocamlbuild. I think it should not be terribly hard to implement -intf-suffix and -impl-suffix in ocamlbuild (you should open a feature wish on the bugtracker http://caml.inria.fr/mantis/ to keep track of this need). In the meantime, you can work around the compiler error messages by using a .xyz -> .ml rule that prepends a lexer directive. At the beginning of each "foo.ml", have # 1 "foo.xyz" to inform the compiler that the "real filename" is foo.xyz (This affect compiler-generated errors. OCamlbuild errors (during the build itself) will still mention the foo.ml file, as the dependency of foo.xyz that failed to build.) On Sun, Aug 2, 2015 at 9:45 PM, Jordan W wrote: > Hello, > > Is there a way to have certain files, with particular suffixes, treated as > .ml/.mli respectively with ocamlbuild? I understand that ocaml compiler > itself supports -intf/-impl/-intf-suffix, but it's not clear that ocamlbuild > will allow use of these. > > Specifically, here is how all of the ocamlc/ocamldep/* suite of commands > should be effected by the file extension: > > */*.xyz > > ocamlc/ocamldep -pp convertXyzProgram -impl theFile.xyz -intf-suffix xyzi > > */*.xyzi > > ocamlc/ocamldep -pp convertXyzProgram -intf theFile.xyzi > > > Is there a way to do this with _tags or possibly resorting to a > myocamlbuild.ml? I would be satisfied with a myocamlbuild rule that *moves* > the .xyz to a .ml, but in that case errors are reported in terms of the > generated .ml and not the original .xyz, which is unfortunate. I know the > ocaml compler supports this, but does ocamlbuild? > > Jordan