From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 6E60F7EE78 for ; Tue, 12 Apr 2016 14:49:25 +0200 (CEST) IronPort-PHdr: 9a23:RXFEghEGpjYFzVL4iIXeiJ1GYnF86YWxBRYc798ds5kLTJ75rsiwAkXT6L1XgUPTWs2DsrQf27qQ7vmrBTNIyK3CmU5BWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYsExnyfTB4Ov7yUtaLyZ/nh6bvotaPPE1hv3mUX/BbFF2OtwLft80b08NJC50a7V/3mEZOYPlc3mhyJFiezF7W78a0+4N/oWwL46pyv/h7TL7icq8kYbtdBTUgeyBptYy4/SXEGCCP/HoHTmIOki1onQfI9lmuVZfrszDmsfJ9nimdMML7V5goRHGo4r1vSRmuhCpRZBAj92SCpcV6lqNWpFqarBxy2YPOKNWaPfBkf67ZO8gRRWdbU9x5WClIA4f6ZIwKWblSdd1EppXw8gNd5SC1AhOhUb++xw== Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=gabriel.scherer@gmail.com; spf=Pass smtp.mailfrom=gabriel.scherer@gmail.com; spf=None smtp.helo=postmaster@mail-io0-f171.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.223.171; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.223.171 as permitted sender) identity=mailfrom; client-ip=209.85.223.171; receiver=mail2-smtp-roc.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 (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-io0-f171.google.com) identity=helo; client-ip=209.85.223.171; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-io0-f171.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BkAQCg7QxXkqvfVdFeg1U1fQaoNYFRhV2NACGFbAKBKgc7EQEBAQEBAQEBEQEBAQEHCwsJIS+CLYIVAQEEEhEdARsSCwEDDAYFCw0CAgkdAgIiAREBBQEKEgYTEhCHbwEDEg6gXIExPjGLNoFqgleHbAoZJwMKUYROAQEBAQEBAQMBAQEBAQEUAQUKBW2FJYRLhD2DAoJWBYYxDJFLgVSEI4gWgjWMW41qER6BDjaCIx6BbiAwigUBAQE X-IPAS-Result: A0BkAQCg7QxXkqvfVdFeg1U1fQaoNYFRhV2NACGFbAKBKgc7EQEBAQEBAQEBEQEBAQEHCwsJIS+CLYIVAQEEEhEdARsSCwEDDAYFCw0CAgkdAgIiAREBBQEKEgYTEhCHbwEDEg6gXIExPjGLNoFqgleHbAoZJwMKUYROAQEBAQEBAQMBAQEBAQEUAQUKBW2FJYRLhD2DAoJWBYYxDJFLgVSEI4gWgjWMW41qER6BDjaCIx6BbiAwigUBAQE X-IronPort-AV: E=Sophos;i="5.24,474,1454972400"; d="scan'208";a="213664280" Received: from mail-io0-f171.google.com ([209.85.223.171]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 12 Apr 2016 14:49:24 +0200 Received: by mail-io0-f171.google.com with SMTP id g185so26287294ioa.2 for ; Tue, 12 Apr 2016 05:49:24 -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-transfer-encoding; bh=iDUVn3/eI6oqXcCsyCTH80KNdcrZbZUDn56B1JS8XvY=; b=T6rOwSiXg4oW6Rawl5ivMUGvygkJ4eZaGdBp5lbsAHwsp2bfYNKDI5XAgqXK2FqOp4 sA7IS5ZSnMfnwucNN6uhEkwEeZzyrkKIlCbcEmEaHyI7QPAL+sOpyKRzOXwPMDrWoR6s BnqeE+EFUCQ8u+/K3Ya4JnpZ2gdd4CSp3re39ZUhvaS6diP+T4Kyw7zrzsBbObaERMej 06LnNpOxqLNBz/V6FYdaKwLmUWpMWFvfSy4XyAAieVovFNYcwmleUO44Qw81OjTstYt0 qIRSoMl+FjtNd5yMfLnSJ4YXLhyI3olrqyVH/7ofawgwcby82V38rHHNGAZ6ZaMVvx82 vOjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=iDUVn3/eI6oqXcCsyCTH80KNdcrZbZUDn56B1JS8XvY=; b=lqVnW0O5Eurvtqk9pq/llhAZly+ISDYCtNYsR2UlgFIRksowDDHbSsP9Ds31HXpC/w lNEWYv9VlDwAOKWT78ZCdYQQEU4DWqUrNLSWo8gB6YvSPtAdfngXMh/gdit0whdpJV58 uqaIXF92eSiE+cGLV851Z3Z/Jd+86KWJUtLiMYmlfZXyuq8wR+6aiOA7IoO5KQJXQ5sa 0OttiYL+PiqS5GGsW+Dl3kY0F+6LYU5OkFEJj3ge4SYyeNC7LOA1+QCVTIuh8ujEvcp0 HfeuYcxe+BHWrQrgcU45oWt3hmP4fDyy8cAI9pHvZFuhU9C2KfCukm/piVFupXBxCDx9 uNdg== X-Gm-Message-State: AOPr4FW81lxtNUfUTjMysO0JYXpzqBeywcaTL7ksBB3VVUbKHkdpcuIjVc6W8HL1sVB3DQcqTgt46emPNoHE9w== X-Received: by 10.107.33.7 with SMTP id h7mr3673819ioh.30.1460465363376; Tue, 12 Apr 2016 05:49:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.17.4 with HTTP; Tue, 12 Apr 2016 05:48:43 -0700 (PDT) In-Reply-To: <570CE35A.4090709@tu-berlin.de> References: <570CE35A.4090709@tu-berlin.de> From: Gabriel Scherer Date: Tue, 12 Apr 2016 08:48:43 -0400 Message-ID: To: =?UTF-8?Q?Christoph_H=C3=B6ger?= Cc: caml users Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] glob-ing dependencies for a custom ocamlbuild rule Ocamlbuild distinguishes "static dependencies", which are expressed in the ~deps argument of the rule declaration, and "dynamic dependencies" which are files required by the rule command. The notion of pattern accepted for static dependencies is indeed rather rigid (less expressive than the patterns used in the _tags file), and what you have in mind does not work. The supported patterns are deterministic: given one file, there is a unique way a pattern can match, and a pattern is instantiated into a single file by any substitution environment. There is a good reason for that: it is not clear what the semantics of your proposal would be. Indeed, ocamlbuild tries to recursively build all static dependencies before deciding to apply a rule, but what does it mean to build all **/*.mo? Listing the one that exist in the source directory is easy, but how would you guess which one to try to build recursively using other rules? Notions such as "all files matching P in this directory" are not stable to the replacement of a source file by an intermediate target: for example if tomorrow you decide that one of the .mo file will be itself pre-processed from a .mo.pp file, it won't be seen by a existing-file globbing technique anymore. You have a lot of flexibility in the behaviors you implement in the build command, so you can easily do the matching there and "build" those files, but it will result in a relatively fragile rule; this is you decision to make, and not in the path of least resistance. On Tue, Apr 12, 2016 at 8:00 AM, Christoph H=C3=B6ger wrote: > Dear all, > > I want to write a custom ocamlbuild rule that basically combines all > source files from a given (sub-)directory and thus depends on these files. > > However, the following does not work: > > rule "normalize (preprocess) a Modelica library" > ~prods:["%.modlib.impl"; "%.modlib.sign"] > ~deps:["%.modlib/**/*.mo"; "%.modlib.depends"] > ~doc:"Preprocesses a Modelica library" > modlibc_command > > It seems that the rule does not expand the pattern in the dependency. Is > there a way to achieve something similar? It would be a major PITA to > add all these files manually... > > regards, > > Christoph > -- > Christoph H=C3=B6ger > > Technische Universit=C3=A4t Berlin > Fakult=C3=A4t IV - Elektrotechnik und Informatik > =C3=9Cbersetzerbau und Programmiersprachen > > Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin > > Tel.: +49 (30) 314-24890 > E-Mail: christoph.hoeger@tu-berlin.de > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs