mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
build: Add a common script for generating OCaml dependencies correctly.
These are generated in many different ways in the various subdirectories, and sometimes not generated correctly. Introduce a script to do this in one place, and hopefully correctly. This is mostly simple refactoring, but I got rid of a couple of things: (1) The ‘make depend’ rule doesn't appear to be needed. automake (or make?) seems to rebuild the ‘.depend’ file automatically just because it is included. (2) I got rid of the hairy path rewriting sed expression. Possibly that is needed for srcdir != builddir.
This commit is contained in:
@@ -185,17 +185,8 @@ guestfs.cmx: guestfs.ml
|
||||
$(guestfs_am_v_ocamlopt)$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -package unix -c $< -o $@
|
||||
endif
|
||||
|
||||
depend: .depend
|
||||
|
||||
.depend: $(wildcard $(abs_srcdir)/*.mli) $(wildcard $(abs_srcdir)/*.ml) $(wildcard $(abs_srcdir)/t/*.ml)
|
||||
rm -f $@ $@-t
|
||||
$(OCAMLFIND) ocamldep -I ../ocaml -I $(abs_srcdir) $^ | \
|
||||
$(SED) 's/ *$$//' | \
|
||||
$(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
|
||||
$(SED) -e 's,$(abs_srcdir)/,$(builddir)/,g' | \
|
||||
sort > $@-t
|
||||
mv $@-t $@
|
||||
|
||||
.depend: *.mli *.ml
|
||||
$(top_builddir)/ocaml-dep.sh $^
|
||||
-include .depend
|
||||
|
||||
SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly
|
||||
|
||||
Reference in New Issue
Block a user