+# Benchmarks.
+
+ifneq ($(TIME),no)
+
+benchmarks: pa_bitstring.cmo bitstring.cma bitstring_persistent.cma
+ @for f in $(BENCHMARKS); do \
+ $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) $(PP) \
+ -package unix -linkpkg -I . bitstring.cmxa $$f.ml -o $$f.opt; \
+ if [ $$? -ne 0 ]; then exit 1; fi; \
+ $(TIME) -f "$$f: %e seconds" $$f.opt; \
+ if [ $$? -ne 0 ]; then exit 1; fi; \
+ done
+ifneq ($(GPROF),no)
+ @for f in $(BENCHMARKS); do \
+ $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) $(PP) -p \
+ -package unix -linkpkg -I . bitstring.cmxa $$f.ml -o $$f.opt.p; \
+ if [ $$? -ne 0 ]; then exit 1; fi; \
+ rm -f gmon.out; \
+ $$f.opt.p; \
+ if [ $$? -ne 0 ]; then exit 1; fi; \
+ gprof $$f.opt.p > $$f.profile; \
+ if [ $$? -ne 0 ]; then exit 1; fi; \
+ echo "Wrote profile of $$f"; \
+ echo " to $$f.profile"; \
+ rm -f gmon.out; \
+ done
+endif
+
+endif
+