Added constructors.
[ocaml-bitstring.git] / Makefile
index 348e320..e1973c8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.1 2008-03-31 22:52:17 rjones Exp $
+# $Id: Makefile,v 1.3 2008-04-01 17:05:37 rjones Exp $
 
 OCAMLFIND = ocamlfind
 OCAMLMKLIB = ocamlmklib
@@ -24,18 +24,22 @@ bitmatch.cma: bitmatch.cmo
 bitmatch.cmxa: bitmatch.cmx
        $(OCAMLFIND) ocamlopt -a -o $@ $^
 
-test:
+test: pa_bitmatch.cmo bitmatch.cma
        @for f in $(TESTS); do \
          echo Test: $$f; \
-         $(OCAMLFIND) ocamlc -pp "camlp4o pa_bitmatch.cmo" \
+         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -pp "camlp4o pa_bitmatch.cmo" \
            -I . bitmatch.cma $$f.ml -o $$f; \
+         if [ $$? -ne 0 ]; then exit 1; fi; \
          $$f; \
+         if [ $$? -ne 0 ]; then exit 1; fi; \
        done
 
 print-tests: pa_bitmatch.cmo
        @for f in $(TESTS); do \
          echo Test: $$f.ml; \
-         camlp4o pa_bitmatch.cmo -printer pr_o.cmo $$f.ml; \
+         cmd="camlp4o pa_bitmatch.cmo -printer pr_o.cmo $$f.ml"; \
+         echo $$cmd; \
+         $$cmd; \
        done
 
 print-examples: pa_bitmatch.cmo