@@ -4,3 +4,5 @@
*.so
*.o
*.a
+*.cmx
+hello.opt
@@ -0,0 +1,5 @@
+hello: hello_stubs.c hello.ml
+ ocamlc -o hello.opt hello.ml hello_stubs.c
+
+hello.opt: hello_stubs.c hello.ml
+ ocamlopt -o hello.opt hello.ml hello_stubs.c
@@ -1 +0,0 @@
-external send_an_int: int -> unit = "get_an_int"
-external send_an_int : int -> unit = "get_an_int"
@@ -0,0 +1,4 @@
+external print_hello: unit -> unit = "caml_print_hello"
+let () =
+ print_hello ()
@@ -2,10 +2,8 @@
#include <caml/mlvalues.h>
CAMLprim value
-get_an_int( value v )
+caml_print_hello(value unit)
{
- int i;
- i = Int_val(v);
- printf("%d\n", i);
+ printf("Hello\n");
return Val_unit;
}