Stable OCaml dependencies.
[ocaml-bitstring.git] / Makefile.in
index a9e0495..cb71f5a 100644 (file)
@@ -26,6 +26,7 @@ OCAMLDOC      = @OCAMLDOC@
 INSTALL                = @INSTALL@
 TIME           = @TIME@
 GPROF          = @GPROF@
+SED            = @SED@
 BISECT_REPORT  = @BISECT_REPORT@
 
 BYTESWAP_H     = @BYTESWAP_H@
@@ -33,8 +34,8 @@ BYTESWAP_H    = @BYTESWAP_H@
 OCAMLLIB       = @OCAMLLIB@
 top_srcdir     = @top_srcdir@
 
-pkg_cil                = @pkg_cil@
-pkg_extlib     = @pkg_extlib@
+pkg_cil                = @OCAML_PKG_cil@
+pkg_extlib     = @OCAML_PKG_extlib@
 
 enable_coverage = @enable_coverage@
 
@@ -109,11 +110,11 @@ bitstring_persistent.cmi: bitstring_persistent.mli
          -I +camlp4 -pp camlp4of -c $<
 
 pa_bitstring.cmo: pa_bitstring.ml bitstring.cma bitstring_persistent.cma
-       $(OCAMLFIND) ocamlc bitstring.cma -I +camlp4 camlp4lib.cma \
+       $(OCAMLFIND) ocamlc bitstring.cma -I +camlp4 dynlink.cma camlp4lib.cma \
          -pp camlp4of -c $< -o $@
 
 bitstring-objinfo: bitstring_objinfo.cmo bitstring.cma bitstring_persistent.cma
-       $(OCAMLFIND) ocamlc -I +camlp4 unix.cma camlp4lib.cma \
+       $(OCAMLFIND) ocamlc -I +camlp4 unix.cma dynlink.cma camlp4lib.cma \
          $(OCAMLCLIBS) \
          bitstring.cma bitstring_persistent.cma \
          $< -o $@
@@ -135,7 +136,12 @@ else
 PP     = -pp 'camlp4o $(OCAMLLIB)/bisect/bisect.cma bitstring.cma bitstring_persistent.cma pa_bitstring.cmo'
 endif
 
-test: pa_bitstring.cmo bitstring.cma bitstring_persistent.cma tests/test.bmpp
+check: test
+
+test: pa_bitstring.cmo \
+       bitstring.cma bitstring_persistent.cma \
+       bitstring.cmxa bitstring_persistent.cmxa \
+       tests/test.bmpp
        @for f in $(TESTS); do \
          echo Building $$f; \
          $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) $(PP) -package unix $(OCAMLOPTLIBS) -I . bitstring.cmxa $$f.ml -o $$f.opt; \
@@ -152,7 +158,7 @@ tests/test.bmpp: create_test_pattern
 
 create_test_pattern: create_test_pattern.cmo
        $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -pp camlp4of \
-         unix.cma -I +camlp4 camlp4lib.cma \
+         unix.cma -I +camlp4 dynlink.cma camlp4lib.cma \
          $(OCAMLCLIBS) \
          -I . bitstring.cma bitstring_persistent.cma $< -o $@
 
@@ -234,11 +240,15 @@ endif
 # Clean.
 
 clean:
-       rm -f core *~ *.cmi *.cmo *.cmx *.cma *.cmxa *.a *.o
-       rm -f tests/*~ tests/*.cmi tests/*.cmo tests/*.opt
-       rm -f examples/*~ examples/*.cmi examples/*.cmo $(EXAMPLES)
+       rm -f core *~ *.cmi *.cmo *.cmx *.cma *.cmxa *.cmp *.a *.o *.so
+       rm -f tests/*~ tests/*.cmi tests/*.cmo tests/*.cmx tests/*.opt
+       rm -f tests/*.o
+       rm -f examples/*~ examples/*.cmi examples/*.cmo examples/*.cmx
+       rm -f examples/*.o $(EXAMPLES)
        rm -f benchmarks/*~ benchmarks/*.cmi benchmarks/*.cmo
+       rm -f benchmarks/*.cmx benchmarks/*.o
        rm -f benchmarks/*.opt benchmarks/*.opt.p benchmarks/*.profile
+       rm -f create_test_pattern bitstring-objinfo
        @for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done
 
 distclean: clean
@@ -267,6 +277,9 @@ install:
                pa_bitstring.cmo
        @for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done
 
+uninstall: 
+       ocamlfind remove bitstring
+
 # Standard rules.
 
 .mli.cmi:
@@ -283,13 +296,20 @@ depend: .depend
          bitstring_persistent.ml bitstring_persistent.mli \
          bitstring_objinfo.ml \
          create_test_pattern.ml
-       rm -f .depend
+       rm -f $@ $@-t
        $(OCAMLFIND) ocamldep $(OCAMLCPACKAGES) \
          bitstring.ml bitstring.mli \
-         bitstring_objinfo.ml >> $@
+         bitstring_objinfo.ml | \
+         $(SED) 's/ :/:/' | \
+         $(SED) 's/ *$$//' | \
+         $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' >> $@-t
        $(OCAMLFIND) ocamldep $(OCAMLCPACKAGES) -pp camlp4of \
          bitstring_persistent.ml bitstring_persistent.mli \
-         create_test_pattern.ml >> $@
+         create_test_pattern.ml | \
+         $(SED) 's/ :/:/' | \
+         $(SED) 's/ *$$//' | \
+         $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' >> $@-t
+       mv $@-t $@
 
 ifeq ($(wildcard .depend),.depend)
 include .depend