[Libguestfs] [PATCH 5/6] out-of-tree build: Fix up OCaml bindings and generator

Hilko Bengen bengen at hilluzination.de
Sun Aug 14 08:58:12 UTC 2011


---
 generator/Makefile.am |    8 ++++----
 ocaml/Makefile.am     |   22 +++++++++++-----------
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/generator/Makefile.am b/generator/Makefile.am
index 112fc69..a127a87 100644
--- a/generator/Makefile.am
+++ b/generator/Makefile.am
@@ -62,14 +62,14 @@ noinst_PROGRAM = generator
 
 if HAVE_OCAML
 
-generator: $(OBJECTS)
-	$(OCAMLC) -o generator $(OCAMLCFLAGS) $(OCAMLCLIBS) $(OBJECTS)
+$(srcdir)/generator: $(OBJECTS)
+	$(OCAMLC) -I $(srcdir) -o $@ $(OCAMLCFLAGS) $(OCAMLCLIBS) $(OBJECTS)
 
 .ml.cmo:
-	$(OCAMLC) $(OCAMLCFLAGS) -c $< -o $@
+	$(OCAMLC) -I $(srcdir) $(OCAMLCFLAGS) -c $< -o $@
 
 .mli.cmi:
-	$(OCAMLC) $(OCAMLCFLAGS) -c $< -o $@
+	$(OCAMLC) -I $(srcdir) $(OCAMLCFLAGS) -c $< -o $@
 
 depend: .depend
 
diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
index 5813f84..7028fa4 100644
--- a/ocaml/Makefile.am
+++ b/ocaml/Makefile.am
@@ -53,16 +53,16 @@ mlguestfs.cmxa: $(XOBJS)
 	$(OCAMLMKLIB) -o mlguestfs $^ -L$(top_builddir)/src/.libs -lguestfs
 
 guestfs_c.o: guestfs_c.c
-	$(CC) $(AM_CPPFLAGS) $(CFLAGS) -fPIC -Wall -c $<
+	$(CC) $(AM_CPPFLAGS) $(CFLAGS) -fPIC -Wall -c $(srcdir)/$<
 
 guestfs_c_actions.o: guestfs_c_actions.c
-	$(CC) $(AM_CPPFLAGS) $(CFLAGS) -fPIC -Wall -c $<
+	$(CC) $(AM_CPPFLAGS) $(CFLAGS) -fPIC -Wall -c $(srcdir)/$<
 
 if HAVE_OCAMLDOC
 
 noinst_DATA += html/index.html
 
-html/index.html: guestfs*.mli guestfs*.ml
+html/index.html: $(srcdir)/guestfs*.mli $(srcdir)/guestfs*.ml
 	mkdir -p html
 	-$(OCAMLDOC) -d html -html $^
 endif
@@ -122,14 +122,14 @@ t/guestfs_070_threads.cmx: t/guestfs_070_threads.ml mlguestfs.cmxa
 	$(OCAMLFIND) ocamlopt -package unix,threads -thread -linkpkg -c $< -o $@
 
 t/%.cmx: t/%.ml mlguestfs.cmxa
-	$(OCAMLFIND) ocamlopt -package unix -linkpkg -c $< -o $@
-
-.mli.cmi:
-	$(OCAMLFIND) ocamlc -package unix -c $< -o $@
-.ml.cmo:
-	$(OCAMLFIND) ocamlc -package unix -c $< -o $@
-.ml.cmx:
-	$(OCAMLFIND) ocamlopt -package unix -c $< -o $@
+	$(OCAMLFIND) ocamlopt -package unix -linkpkg -c $< -o $(builddir)/$@
+
+%.cmi: %.mli
+	$(OCAMLFIND) ocamlc -package unix -c $< -o $(builddir)/$@
+%.cmo: %.ml
+	$(OCAMLFIND) ocamlc -package unix -c $< -o $(builddir)/$@
+%.cmx: %.ml
+	$(OCAMLFIND) ocamlopt -package unix -c $< -o $(builddir)/$@
 
 depend: .depend
 
-- 
1.7.5.4




More information about the Libguestfs mailing list