diff --git a/code/back-end-embed/build_embed_binary.rawsh b/code/back-end-embed/build_embed_binary.rawsh new file mode 100644 index 0000000..00f7de7 --- /dev/null +++ b/code/back-end-embed/build_embed_binary.rawsh @@ -0,0 +1,7 @@ +$ gcc -fPIC -Wall -I`ocamlc -where` -L`ocamlc -where` -ltermcap -lm -ldl \ + -o finalbc.native main.c embed_out.o -lcamlrun +$ ./finalbc.native +Before calling OCaml +hello embedded world 1 +hello embedded world 2 +After calling OCaml diff --git a/code/back-end-embed/build_embed_native.rawsh b/code/back-end-embed/build_embed_native.rawsh new file mode 100644 index 0000000..27eb01d --- /dev/null +++ b/code/back-end-embed/build_embed_native.rawsh @@ -0,0 +1,8 @@ +$ ocamlopt -output-obj -o embed_native.o embed_me1.ml embed_me2.ml +$ gcc -Wall -I `ocamlc -where` -o final.native embed_native.o main.c \ + -L `ocamlc -where` -lasmrun -ltermcap -lm -ldl +$ ./final.native +Before calling OCaml +hello embedded world 1 +hello embedded world 2 +After calling OCaml diff --git a/code/back-end-embed/build_embed_binary.sh b/code/back-end-embed/xbuild_embed_binary.sh similarity index 100% rename from code/back-end-embed/build_embed_binary.sh rename to code/back-end-embed/xbuild_embed_binary.sh diff --git a/code/back-end-embed/build_embed_native.sh b/code/back-end-embed/xbuild_embed_native.sh similarity index 100% rename from code/back-end-embed/build_embed_native.sh rename to code/back-end-embed/xbuild_embed_native.sh