-pa_bitmatch.cmo: pa_bitmatch.ml bitmatch.cma
- $(OCAMLFIND) ocamlc bitmatch.cma -I +camlp4 camlp4lib.cma \
- -pp camlp4of.opt -c $< -o $@
+bitstring_persistent.cmx: bitstring_persistent.ml
+ $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) \
+ -I +camlp4 -pp camlp4of -c $<
+
+bitstring_persistent.cmi: bitstring_persistent.mli
+ $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) \
+ -I +camlp4 -pp camlp4of -c $<
+
+pa_bitstring.cmo: pa_bitstring.ml bitstring.cma bitstring_persistent.cma
+ $(OCAMLFIND) ocamlc bitstring.cma -I +camlp4 camlp4lib.cma \
+ -pp camlp4of -c $< -o $@
+
+bitstring-objinfo: bitstring_objinfo.cmo bitstring.cma bitstring_persistent.cma
+ $(OCAMLFIND) ocamlc -I +camlp4 unix.cma camlp4lib.cma \
+ bitstring.cma bitstring_persistent.cma \
+ $< -o $@
+
+# Create byteswap.h if the system doesn't have this file.
+# From gnulib, license is LGPLv2+.
+
+byteswap.h: byteswap.in.h
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ cat $(srcdir)/byteswap.in.h; \
+ } > $@-t
+ mv -f $@-t $@