caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Ocamlbuild question
@ 2009-02-11 22:26 Matthieu Dubuget
  2009-02-12 16:00 ` [Caml-list] " Nicolas Pouillard
  0 siblings, 1 reply; 9+ messages in thread
From: Matthieu Dubuget @ 2009-02-11 22:26 UTC (permalink / raw)
  To: caml-list

Hello,

I'm trying to manage "internal" camlfind packages. I use "internal" with
the same meanning than in ocamlbuild documentation when speaking about
libraries.

I want my camlfind packages to be re-installed if one of their
dependency was modified. For this, I wrote a simple rule, based on
%.iocamlfind files containing the files to install into findlib
directory. This rule also produces a stamp file : %.oocamlfind.

I also want my camlfind package to be installed if they are needed by
another rule. For this, I do: dep ["pkg_"^nm][nm ^ ".oocamlfind"] for
each internal package.

It seems to work ok: Suppose that package toto requires package tutu.
When I ask ocamlbuild toto.oocamlfind, the packages tutu is re-built if
needed. And if I modify one file of tutu, and then ask ocamlbuild to
generate toto.oocamlbuild, tutu is re-built and installed into findlib
directories. fine.

BUT, when I'm producing a %.native from %.cmx, my dependencies (ie
%.oocamlfind files) are inserted in the command line...

Here is an example:
ocamlfind ocamlopt -linkpkg -package mtsvrac -package log
logtest/test.cmx mtsvrac.oocamlfind log.oocamlfind -o logtest/test.native

mtsvrac.oocamlfind and log.oocamlfind where added to the dependencies of
logtest/test.native.

What would be the right solution to avoid this problem?
Is there something like a "dependency that should not be linked?"

Thanks

Salutations

Matt



^ permalink raw reply	[flat|nested] 9+ messages in thread
* [Caml-list] Ocamlbuild question
@ 2011-05-19 10:50 Matthieu Dubuget
  2011-05-19 11:34 ` Gabriel Scherer
  0 siblings, 1 reply; 9+ messages in thread
From: Matthieu Dubuget @ 2011-05-19 10:50 UTC (permalink / raw)
  To: Caml Mailing List

Hello,

I'm trying to build xml-light using ocamlbuild (don't ask me why, I do 
not know myself…)

The standard way for building xml-light.cma is working (with a patch 
stolen from debian package):

> wget http://tech.motion-twin.com/zip/xml-light-2.2.zip
> unzip xml-light-2.2.zip
> cd xml-light
> sed -i -e 's/.mly.ml:/%mli %ml: %mly/' Makefile
> make xml-light.cma


> ...
>
> ocamlyacc xml_parser.mly
> ocamlc xml.mli
> ocamlc dtd.mli
> ocamlc xml_parser.mli
> ocamlc -c xml_parser.ml
> ocamllex xml_lexer.mll
> 228 states, 1162 transitions, table size 6016 bytes
> ocamlc xml_lexer.mli
> ocamlc -c xml_lexer.ml
> ocamlc -c dtd.ml
> ocamlc xmlParser.mli
> ocamlc -c xmlParser.ml
> ocamlc -c xml.ml
> ocamlc -o xml-light.cma -a xml_parser.cmo xml_lexer.cmo dtd.cmo 
> xmlParser.cmo xml.cmo

Here is my try with ocamlbuild:

> wget http://tech.motion-twin.com/zip/xml-light-2.2.zip
> unzip xml-light-2.2.zip
> cd xml-light
> for d in Xml_parser Xml_lexer Dtd XmlParser Xml;
> do echo "$d" >> xml-light.mllib;
> done
> ocamlbuild xml-light.cma
> ls _build/*.cmo

> ...
>
> Circular dependencies: "dtd.cmo" already seen in
> [ "xml.cmo"; "dtd.cmo"; "xml_parser.cmo" ]
>
> Compilation unsuccessful after building 22 targets (0 cached) in 00:00:00.
> _build/dtd.cmo _build/xml.cmo _build/xml_lexer.cmo 
> _build/xml_parser.cmo _build/xmlParser.cmo

I would like to understand the origin of the problem?

Salutations

Matthieu



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

end of thread, other threads:[~2011-05-19 11:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-11 22:26 Ocamlbuild question Matthieu Dubuget
2009-02-12 16:00 ` [Caml-list] " Nicolas Pouillard
2009-02-12 17:32   ` Matthieu Dubuget
2009-02-12 18:33     ` Matthieu Dubuget
2009-02-13 10:56       ` Matthieu Dubuget
2009-02-13 16:06         ` Matthieu Dubuget
2009-02-16 13:07           ` Matthieu Dubuget
2011-05-19 10:50 Matthieu Dubuget
2011-05-19 11:34 ` Gabriel Scherer

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