caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jake Donham <jake.donham@skydeck.com>
To: caml-list@inria.fr
Subject: ocamlbuild: args to tags?
Date: Tue, 18 Sep 2007 11:01:56 -0700	[thread overview]
Message-ID: <46F01294.7060806@skydeck.com> (raw)

Hi,

Is there a way to pass arguments to a preprocessor via the _tags file? 
(In particular, I have added a -classes option to Deriving to give 
default classes to all the types in a file.). Following the recent 
discussion, I have this in myocamlbuild.ml:

   dispatch begin function
     | After_rules ->
         flag ["ocaml"; "pp"; "deriving"] (A"deriving");
         flag ["ocaml"; "pp"; "Show"] (S[A"-classes"; A"Show"]);

So now if I put

   <foo.ml> : deriving,Show

in _tags I get -pp 'deriving -classes Show' in the command line. What I 
would like, however, is to be able to write

   <foo.ml> : deriving(Show,Typeable)

or

   <foo.ml> : deriving,classes(Show,Typeable)

i.e. to be able to pass some arbitrary args rather than hard-coding Show 
as a tag. Is there any way to do this? I don't understand how Ocamlbuild 
decides whether flags should be associated with the main command or with 
the preprocessor command; if I write classes(Foo) in _tags I get 
-classes Foo in the main command, no matter what I have tried in 
myocamlbuild.ml.

Thanks,

Jake


             reply	other threads:[~2007-09-18 18:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-18 18:01 Jake Donham [this message]
2007-09-24 12:29 ` [Caml-list] " Nicolas Pouillard
2007-09-24 14:03   ` skaller
2007-09-24 15:23     ` Nicolas Pouillard
2007-09-24 17:38       ` skaller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46F01294.7060806@skydeck.com \
    --to=jake.donham@skydeck.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).