From: Joel Reymont <joelr1@gmail.com>
To: "Nicolas Pouillard" <nicolas.pouillard@gmail.com>
Cc: "Caml List" <caml-list@inria.fr>
Subject: Re: [Caml-list] Producing a C wrapper with ocamlbuild or OMake
Date: Wed, 28 Mar 2007 14:25:43 +0100 [thread overview]
Message-ID: <5FF6CDCC-AE05-472F-B721-782D32302EB7@gmail.com> (raw)
In-Reply-To: <cd67f63a0703280538r73ad2bd6j9594e2791b9bdbe0@mail.gmail.com>
Nicolas,
I think I'm missing one more bit:
ocamlbuild main
+ ocamlfind ocamlopt -package ounit -output-obj morpher.ml -o
morphercaml.o
No implementations provided for the following modules:
Symtab referenced from morpher.cmx
Ninja referenced from morpher.cmx
Easy_lexer referenced from morpher.cmx
Easy_parser referenced from morpher.cmx
Ppninja referenced from morpher.cmx
Pretty referenced from morpher.cmx
Parser_util referenced from morpher.cmx
Ninja_morph referenced from morpher.cmx
Command exited with code 2.
Compilation unsuccessful after building 2 targets (1 cached) in
00:00:00.
My complete plugin file is below. I can build my test program just
fine using
ocamlbuild test.byte
but trying to produce the library gives me the above error.
What am I missing? How can I have morpher.ml automatically pull in
the other modules?
I do open modules at the top of morpher.ml like this
open Ninja_morph
open Parser_util
module PP = Ppninja
module N = Ninja
Thanks, Joel
---
open Ocamlbuild_plugin;;
open Command;;
let cc = A"cc";;
let ar = A"ar";;
let packages = "ounit" (* "pkg1,pkg2,..." *);;
let ocamlfind cmd =
S[A"ocamlfind"; A cmd; A"-package"; A packages];;
flag ["ocaml"; "link"] (A"-linkpkg");;
dispatch begin function
| After_options ->
Options.ocamlc := ocamlfind "ocamlc";
Options.ocamlopt := ocamlfind "ocamlopt";
| After_rules ->
rule "output C obj"
~dep:"%.ml"
~prod:"%caml.o"
begin fun env _ ->
let caml_o = env "%caml.o" and ml = env "%.ml" in
Cmd(S[!Options.ocamlopt; A"-output-obj"; P ml; A"-o"; Px
caml_o])
end;
rule "build C lib"
~deps:["%_stubs.o"; "%caml.o"]
~prod:"lib%.a"
begin fun env _ ->
let wrap_o = env "%wrap.o"
and caml_o = env "%caml.o"
and libasmrun = !
*Ocamlbuild_pack.Ocaml_utils.stdlib_dir/"libasmrun.a"
and lib_a = env "lib%.a" in
Seq[cp libasmrun lib_a;
Cmd(S[ar; A"r"; Px lib_a; P caml_o; P wrap_o])]
end;
rule "build morpher"
~deps:["libmorpher.a"; "main.o"]
~prod:"main"
begin fun _ _ ->
Cmd(S[cc; P"morpher.o"; P"libmorpher.a"; A"-o"; Px"main"])
end;
| _ -> ()
end
--
http://wagerlabs.com/
next prev parent reply other threads:[~2007-03-28 13:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-27 23:10 Joel Reymont
2007-03-28 8:53 ` [Caml-list] " Nicolas Pouillard
[not found] ` <cd67f63a0703280158g559eff38pb6cca758682cad4a@mail.gmail.com>
2007-03-28 9:04 ` Joel Reymont
2007-03-28 12:38 ` Nicolas Pouillard
2007-03-28 13:25 ` Joel Reymont [this message]
2007-03-28 13:57 ` Nicolas Pouillard
2007-03-28 14:10 ` Joel Reymont
2007-03-28 15:46 ` Nicolas Pouillard
2007-03-28 18:58 ` Joel Reymont
2007-03-28 21:13 ` Nicolas Pouillard
2007-03-28 14:44 ` Joel Reymont
2007-03-28 15:49 ` Nicolas Pouillard
2007-03-28 22:46 ` Joel Reymont
2007-03-29 11:20 ` Nicolas Pouillard
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=5FF6CDCC-AE05-472F-B721-782D32302EB7@gmail.com \
--to=joelr1@gmail.com \
--cc=caml-list@inria.fr \
--cc=nicolas.pouillard@gmail.com \
/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