Stable OCaml dependencies.
authorRichard Jones <rjones@redhat.com>
Mon, 12 Sep 2011 09:07:31 +0000 (10:07 +0100)
committerRichard Jones <rjones@redhat.com>
Mon, 12 Sep 2011 09:09:59 +0000 (10:09 +0100)
This technique copied from libguestfs/resize/Makefile.am and modified
so that it works with old ocamldep that used to add spaces at the end
of lines.

configure.ac
src/.depend
src/Makefile.am

index 46039da..a75a581 100644 (file)
@@ -37,6 +37,9 @@ AC_SYS_LARGEFILE
 
 gl_INIT
 
+# Define $(SED).
+AC_PROG_SED
+
 # OCaml and ocamlfind are required to compile.
 AC_PROG_OCAML
 if test "$OCAMLC" = "no"; then
index e71f272..33b1cfb 100644 (file)
@@ -3,27 +3,17 @@ config.cmx:
 febootstrap_cmdline.cmi:
 febootstrap_cmdline.cmo: config.cmo febootstrap_cmdline.cmi
 febootstrap_cmdline.cmx: config.cmx febootstrap_cmdline.cmi
+febootstrap.cmo: febootstrap_utils.cmi febootstrap_package_handlers.cmi febootstrap_cmdline.cmi config.cmo
+febootstrap.cmx: febootstrap_utils.cmx febootstrap_package_handlers.cmx febootstrap_cmdline.cmx config.cmx
+febootstrap_debian.cmo: febootstrap_utils.cmi febootstrap_package_handlers.cmi febootstrap_cmdline.cmi config.cmo
+febootstrap_debian.cmx: febootstrap_utils.cmx febootstrap_package_handlers.cmx febootstrap_cmdline.cmx config.cmx
+febootstrap_package_handlers.cmi:
+febootstrap_package_handlers.cmo: febootstrap_utils.cmi febootstrap_cmdline.cmi febootstrap_package_handlers.cmi
+febootstrap_package_handlers.cmx: febootstrap_utils.cmx febootstrap_cmdline.cmx febootstrap_package_handlers.cmi
+febootstrap_pacman.cmo: febootstrap_utils.cmi febootstrap_package_handlers.cmi febootstrap_cmdline.cmi config.cmo
+febootstrap_pacman.cmx: febootstrap_utils.cmx febootstrap_package_handlers.cmx febootstrap_cmdline.cmx config.cmx
 febootstrap_utils.cmi:
 febootstrap_utils.cmo: febootstrap_cmdline.cmi febootstrap_utils.cmi
 febootstrap_utils.cmx: febootstrap_cmdline.cmx febootstrap_utils.cmi
-febootstrap_package_handlers.cmi:
-febootstrap_package_handlers.cmo: febootstrap_utils.cmi \
-    febootstrap_cmdline.cmi febootstrap_package_handlers.cmi
-febootstrap_package_handlers.cmx: febootstrap_utils.cmx \
-    febootstrap_cmdline.cmx febootstrap_package_handlers.cmi
-febootstrap_yum_rpm.cmo: febootstrap_utils.cmi \
-    febootstrap_package_handlers.cmi febootstrap_cmdline.cmi config.cmo
-febootstrap_yum_rpm.cmx: febootstrap_utils.cmx \
-    febootstrap_package_handlers.cmx febootstrap_cmdline.cmx config.cmx
-febootstrap_debian.cmo: febootstrap_utils.cmi \
-    febootstrap_package_handlers.cmi febootstrap_cmdline.cmi config.cmo
-febootstrap_debian.cmx: febootstrap_utils.cmx \
-    febootstrap_package_handlers.cmx febootstrap_cmdline.cmx config.cmx
-febootstrap_pacman.cmo: febootstrap_utils.cmi \
-    febootstrap_package_handlers.cmi febootstrap_cmdline.cmi config.cmo
-febootstrap_pacman.cmx: febootstrap_utils.cmx \
-    febootstrap_package_handlers.cmx febootstrap_cmdline.cmx config.cmx
-febootstrap.cmo: febootstrap_utils.cmi febootstrap_package_handlers.cmi \
-    febootstrap_cmdline.cmi config.cmo
-febootstrap.cmx: febootstrap_utils.cmx febootstrap_package_handlers.cmx \
-    febootstrap_cmdline.cmx config.cmx
+febootstrap_yum_rpm.cmo: febootstrap_utils.cmi febootstrap_package_handlers.cmi febootstrap_cmdline.cmi config.cmo
+febootstrap_yum_rpm.cmx: febootstrap_utils.cmx febootstrap_package_handlers.cmx febootstrap_cmdline.cmx config.cmx
index b715c9f..2bcad79 100644 (file)
@@ -73,7 +73,10 @@ depend: .depend
 
 .depend: $(SOURCES)
        rm -f $@ $@-t
-       $(OCAMLFIND) ocamldep $^ > $@-t
+       $(OCAMLFIND) ocamldep $^ | \
+         $(SED) 's/ *$$//' | \
+         $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
+         sort > $@-t
        mv $@-t $@
 
 include .depend