* ocamlbuild bug and questions Was: Re: [Caml-list] ocamlbuild: using *.itarget with flags
@ 2007-11-21 18:51 viktor tron
2007-11-22 16:36 ` viktor tron
0 siblings, 1 reply; 3+ messages in thread
From: viktor tron @ 2007-11-21 18:51 UTC (permalink / raw)
To: caml-list
[-- Attachment #1: Type: text/plain, Size: 1575 bytes --]
On 21/11/2007, Nicolas Pouillard < nicolas.pouillard@gmail.com> wrote:
>
> Excerpts from hmf's message of Wed Nov 21 12:30:28 +0100 2007:
> > The manual states that in the *.itarget
> > files a comment is either a blank or dash.
> > Does this mean:
> >
> > - comment here
> >
> > is a comment? If so, it does not seem
> > to work.
>
> The manual is wrong on that point, it's a sharp (#) not a dash (-).
>
> # comment here
>
I also noticed that. Plus what seems to be a couple of bugs?
$ echo -n '# comment here' > _tags
$ ocamlbuild target
Lexical analysis error: Bad key in configuration line at line 1 (from file:
"_tags")
or even worse
$ echo -n '# comment here:' > _tags
$ ocamlbuild target
Failure: lexing: empty token.
Also: I had a number of question concerning ocamlbuild in my recent post
about c libs from ocaml.
I elaborate them here, but see my original post for the context.
Does anyone have an illuminating insight?
---
* I still don't know the most basic thing, how to build an output-obj o
file.
* I found no way to convince ocamlbuild to use the local library (in this
example we build
ocamlbuild foo.cmxa
and then would simply want
ocamlopt -o foo foo.cmxa foo_wrapper.ml
but 'ocamlbuild foo_wrapper.native' rebuilds it all the same
* I don't know what the possible tags are, how I add them.
* If I use a syntax extension which has to be build, adding the pp... tag
does not create a dependency which is checked. I don't know how to add this
dependency.
Help appreciated, but probably a more detailed manual will solve
this with time.
Viktor
[-- Attachment #2: Type: text/html, Size: 2364 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* ocamlbuild bug and questions Was: Re: [Caml-list] ocamlbuild: using *.itarget with flags
2007-11-21 18:51 ocamlbuild bug and questions Was: Re: [Caml-list] ocamlbuild: using *.itarget with flags viktor tron
@ 2007-11-22 16:36 ` viktor tron
2007-11-23 8:05 ` Nicolas Pouillard
0 siblings, 1 reply; 3+ messages in thread
From: viktor tron @ 2007-11-22 16:36 UTC (permalink / raw)
To: caml-list
[-- Attachment #1: Type: text/plain, Size: 1575 bytes --]
On 21/11/2007, Nicolas Pouillard < nicolas.pouillard@gmail.com> wrote:
>
> Excerpts from hmf's message of Wed Nov 21 12:30:28 +0100 2007:
> > The manual states that in the *.itarget
> > files a comment is either a blank or dash.
> > Does this mean:
> >
> > - comment here
> >
> > is a comment? If so, it does not seem
> > to work.
>
> The manual is wrong on that point, it's a sharp (#) not a dash (-).
>
> # comment here
>
I also noticed that. Plus what seems to be a couple of bugs?
$ echo -n '# comment here' > _tags
$ ocamlbuild target
Lexical analysis error: Bad key in configuration line at line 1 (from file:
"_tags")
or even worse
$ echo -n '# comment here:' > _tags
$ ocamlbuild target
Failure: lexing: empty token.
Also: I had a number of question concerning ocamlbuild in my recent post
about c libs from ocaml.
I elaborate them here, but see my original post for the context.
Does anyone have an illuminating insight?
---
* I still don't know the most basic thing, how to build an output-obj o
file.
* I found no way to convince ocamlbuild to use the local library (in this
example we build
ocamlbuild foo.cmxa
and then would simply want
ocamlopt -o foo foo.cmxa foo_wrapper.ml
but 'ocamlbuild foo_wrapper.native' rebuilds it all the same
* I don't know what the possible tags are, how I add them.
* If I use a syntax extension which has to be build, adding the pp... tag
does not create a dependency which is checked. I don't know how to add this
dependency.
Help appreciated, but probably a more detailed manual will solve
this with time.
Viktor
[-- Attachment #2: Type: text/html, Size: 2396 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ocamlbuild bug and questions Was: Re: [Caml-list] ocamlbuild: using *.itarget with flags
2007-11-22 16:36 ` viktor tron
@ 2007-11-23 8:05 ` Nicolas Pouillard
0 siblings, 0 replies; 3+ messages in thread
From: Nicolas Pouillard @ 2007-11-23 8:05 UTC (permalink / raw)
To: viktor.tron.ml; +Cc: caml-list
Excerpts from viktor.tron.ml's message of Thu Nov 22 17:36:14 +0100 2007:
> On 21/11/2007, Nicolas Pouillard < nicolas.pouillard@gmail.com> wrote:
> >
> > Excerpts from hmf's message of Wed Nov 21 12:30:28 +0100 2007:
> > > The manual states that in the *.itarget
> > > files a comment is either a blank or dash.
> > > Does this mean:
> > >
> > > - comment here
> > >
> > > is a comment? If so, it does not seem
> > > to work.
> >
> > The manual is wrong on that point, it's a sharp (#) not a dash (-).
> >
> > # comment here
> >
>
> I also noticed that. Plus what seems to be a couple of bugs?
>
> $ echo -n '# comment here' > _tags
> $ ocamlbuild target
> Lexical analysis error: Bad key in configuration line at line 1 (from file:
> "_tags")
Yes your right, comments should end by a new line (I fix that).
> or even worse
>
> $ echo -n '# comment here:' > _tags
> $ ocamlbuild target
> Failure: lexing: empty token.
Yes that's the same one.
> Also: I had a number of question concerning ocamlbuild in my recent post
> about c libs from ocaml.
> I elaborate them here, but see my original post for the context.
> Does anyone have an illuminating insight?
>
> ---
>
> * I still don't know the most basic thing, how to build an output-obj o
> file.
That's not "the most basic thing" for the average OCaml programmer I think.
Ocamlbuild don't have such a rule by default (I think it will). However
define your own custom rule is really feasible.
(* something like that, but I've not tested *)
rule "the rule name"
~deps:["foo.cmo"; "libbar.a"(*...*)]
~prods:["obj.o"(*...*)]
begin fun _ _ ->
Cmd(S[V"OCAMLC"; A"-output-obj"; A"-o"; Px"obj.o"; P"foo.cmo"; P"libbar.a"(*...*)])
end;
> * I found no way to convince ocamlbuild to use the local library (in this
> example we build
> ocamlbuild foo.cmxa
> and then would simply want
> ocamlopt -o foo foo.cmxa foo_wrapper.ml
> but 'ocamlbuild foo_wrapper.native' rebuilds it all the same
in the myocamlbuild.ml you have to declare the library:
ocaml_lib "foo"
and in the _tags file:
"foo_wrapper.native": use_foo
> * I don't know what the possible tags are, how I add them.
They are implicitly declared, for instance if you add:
flag ["ocaml"; "link"; "byte"; "mytag"] (S[A"-cclib"; A"mycopt"]);
You can then tag some .byte files with mytag, -cclib mycopt flags will be
added at link time.
> * If I use a syntax extension which has to be build, adding the pp... tag
> does not create a dependency which is checked. I don't know how to add this
> dependency.
Use a dep declaration with same tags and then files that needs to be built.
dep ["ocaml"; "pp"; ...] ["myextension.cmo"]
> Help appreciated, but probably a more detailed manual will solve
> this with time.
The wiki [1] talk about using syntax extension.
[1]: http://brion.inria.fr/gallium/index.php/A_plugin_for_camlp4_syntax_extension_%28pa_openin%29
--
Nicolas Pouillard aka Ertai
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-11-23 8:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-21 18:51 ocamlbuild bug and questions Was: Re: [Caml-list] ocamlbuild: using *.itarget with flags viktor tron
2007-11-22 16:36 ` viktor tron
2007-11-23 8:05 ` Nicolas Pouillard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox