Skip to content
Browse files

This commit was manufactured by cvs2svn to create tag 'ocaml3101rc2'.

git-svn-id: http://caml.inria.fr/svn/ocaml/release/3.10.1-rc2@8740 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information...
1 parent 0ec7a16 commit 3987b2ca74334b35b84b607529f4ba028de9af73 (no author) committed Jan 2, 2008
View
1 ocamlbuild/examples/example_with_C/_tags
@@ -1 +0,0 @@
-<*caml.o>: output_obj
View
5 ocamlbuild/examples/example_with_C/fib.ml
@@ -1,5 +0,0 @@
-let x = X.x
-
-let rec fib n = if n <= 1 then 1 else fib (n - 1) + fib (n - 2)
-
-let () = Callback.register "fib" fib
View
7 ocamlbuild/examples/example_with_C/fibwrap.c
@@ -1,7 +0,0 @@
- /* -*- C -*- */
-#include <caml/mlvalues.h>
-#include <caml/callback.h>
-int fib(int n)
-{
- return Int_val(caml_callback(*caml_named_value("fib"), Val_int(n)));
-}
View
10 ocamlbuild/examples/example_with_C/main.c
@@ -1,10 +0,0 @@
- /* -*- C -*- */
-#include <stdio.h>
-#include <caml/callback.h>
-extern int fib(int);
-int main(int argc, char** argv)
-{
- caml_startup(argv);
- printf("fib(12) = %d\n", fib(12));
- return 0;
-}
View
35 ocamlbuild/examples/example_with_C/myocamlbuild.ml
@@ -1,35 +0,0 @@
-open Ocamlbuild_plugin;;
-open Command;;
-
-let cc = A"cc";;
-let ar = A"ar";;
-
-dispatch begin function
-| After_rules ->
- let libasmrun = !*Ocamlbuild_pack.Ocaml_utils.stdlib_dir/"libasmrun.a" in
-
- flag ["ocaml"; "link"; "output_obj"] (A"-output-obj");
-
- rule "output C obj"
- ~deps:["%.cmx"; "%.o"]
- ~prod:"%caml.o"
- (Ocamlbuild_pack.Ocaml_compiler.native_link "%.cmx" "%caml.o");
-
- rule "build C lib"
- ~deps:["%wrap.o"; "%caml.o"]
- ~prod:"lib%.a"
- begin fun env _ ->
- let wrap_o = env "%wrap.o" and caml_o = env "%caml.o"
- 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 main"
- ~deps:["libfib.a"; "main.o"]
- ~prod:"main"
- begin fun _ _ ->
- Cmd(S[cc; P"main.o"; P"libfib.a"; A"-o"; Px"main"])
- end;
-| _ -> ()
-end
-
View
1 ocamlbuild/examples/example_with_C/x.ml
@@ -1 +0,0 @@
-let x = 42
View
1 ocamlbuild/test/test_virtual/foo.itarget
@@ -1 +0,0 @@
-foo
View
1 ocamlbuild/test/test_virtual/foo1
@@ -1 +0,0 @@
-foo1
View
1 ocamlbuild/test/test_virtual/foo2
@@ -1 +0,0 @@
-foo2
View
11 ocamlbuild/test/test_virtual/myocamlbuild.ml
@@ -1,11 +0,0 @@
-open Ocamlbuild_plugin;;
-dispatch begin function
- | After_rules ->
- rule "copy foo"
- ~prod:"bar"
- ~dep:"foo.otarget"
- begin fun _env _build ->
- cp "foo" "bar"
- end
- | _ -> ()
-end
View
16 ocamlbuild/test/test_virtual/test.sh
@@ -1,16 +0,0 @@
-#!/bin/sh
-cd `dirname $0`
-set -e
-set -x
-CMDOPTS="" # -- command args
-BUILD="../../_build/ocamlbuild.native bar -no-skip -classic-display $@"
-BUILD1="$BUILD $CMDOPTS"
-BUILD2="$BUILD -verbose 0 -nothing-should-be-rebuilt $CMDOPTS"
-rm -rf _build
-cp foo1 foo
-$BUILD1
-$BUILD2
-cp foo2 foo
-$BUILD1 -verbose 0
-$BUILD2
-rm foo

0 comments on commit 3987b2c

Please sign in to comment.
Something went wrong with that request. Please try again.