summaryrefslogtreecommitdiff
path: root/ocaml-binary-annot/testsuite/tests/lib-dynlink-bytecode/Makefile
diff options
context:
space:
mode:
authorFabrice Le Fessant <Fabrice.Le_fessant@inria.fr>2010-11-11 06:38:31 +0000
committerFabrice Le Fessant <Fabrice.Le_fessant@inria.fr>2010-11-11 06:38:31 +0000
commit174df0ab26c2fb06a075df6fe8d598fd89234cd9 (patch)
tree3ddbb0018e6476873891710a95f04190bddff923 /ocaml-binary-annot/testsuite/tests/lib-dynlink-bytecode/Makefile
downloadocaml-174df0ab26c2fb06a075df6fe8d598fd89234cd9.tar.gz
New branch binary-annot by Fabrice Le Fessant from r10789
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/binary-annot@10790 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'ocaml-binary-annot/testsuite/tests/lib-dynlink-bytecode/Makefile')
-rw-r--r--ocaml-binary-annot/testsuite/tests/lib-dynlink-bytecode/Makefile36
1 files changed, 36 insertions, 0 deletions
diff --git a/ocaml-binary-annot/testsuite/tests/lib-dynlink-bytecode/Makefile b/ocaml-binary-annot/testsuite/tests/lib-dynlink-bytecode/Makefile
new file mode 100644
index 0000000000..00ffc63ad3
--- /dev/null
+++ b/ocaml-binary-annot/testsuite/tests/lib-dynlink-bytecode/Makefile
@@ -0,0 +1,36 @@
+default: compile run
+
+compile:
+ @for file in stub*.c; do \
+ $(OCAMLC) -c $$file; \
+ $(OCAMLMKLIB) -o `echo $$file | sed -e 's/stub/plug/' | sed -e 's/\.c//'` `basename $$file c`o; \
+ done
+ @for file in plug*.ml; do \
+ $(OCAMLC) -c $$file; \
+ $(OCAMLMKLIB) -o `basename $$file .ml` `basename $$file ml`cmo; \
+ done
+ @$(OCAMLC) -c main.ml
+ @$(OCAMLC) -o main dynlink.cma main.cmo
+ @$(OCAMLC) -o static -linkall plug1.cma plug2.cma -use-runtime $(PREFIX)/bin/ocamlrun
+ @$(OCAMLC) -o custom -custom -linkall plug2.cma plug1.cma -I .
+
+run:
+ @printf " ... testing 'main'"
+ @export LD_LIBRARY_PATH=`pwd` && ./main plug1.cma plug2.cma > main.result
+ @diff -q main.reference main.result > /dev/null || (echo " => failed" && exit 1)
+ @echo " => passed"
+
+ @printf " ... testing 'static'"
+ @export LD_LIBRARY_PATH=`pwd` && ./static > static.result
+ @diff -q static.reference static.result > /dev/null || (echo " => failed" && exit 1)
+ @echo " => passed"
+
+ @printf " ... testing 'custom'"
+ @export LD_LIBRARY_PATH=`pwd` && ./custom > custom.result
+ @diff -q custom.reference custom.result > /dev/null || (echo " => failed" && exit 1)
+ @echo " => passed"
+
+clean: defaultclean
+ @rm -f ./main ./static ./custom *.result
+
+include ../../makefiles/Makefile.common