caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* ocamlbuild: args to tags?
@ 2007-09-18 18:01 Jake Donham
  2007-09-24 12:29 ` [Caml-list] " Nicolas Pouillard
  0 siblings, 1 reply; 5+ messages in thread
From: Jake Donham @ 2007-09-18 18:01 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-09-24 17:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-18 18:01 ocamlbuild: args to tags? Jake Donham
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

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).