out-of-tree build: Fix up OCaml bindings and generator
authorHilko Bengen <bengen@hilluzination.de>
Sun, 14 Aug 2011 08:58:12 +0000 (10:58 +0200)
committerRichard W.M. Jones <rjones@redhat.com>
Mon, 15 Aug 2011 13:50:33 +0000 (14:50 +0100)
generator/Makefile.am
ocaml/Makefile.am

index 112fc69..a127a87 100644 (file)
@@ -62,14 +62,14 @@ noinst_PROGRAM = generator
 
 if HAVE_OCAML
 
 
 if HAVE_OCAML
 
-generator: $(OBJECTS)
-       $(OCAMLC) -o generator $(OCAMLCFLAGS) $(OCAMLCLIBS) $(OBJECTS)
+$(srcdir)/generator: $(OBJECTS)
+       $(OCAMLC) -I $(srcdir) -o $@ $(OCAMLCFLAGS) $(OCAMLCLIBS) $(OBJECTS)
 
 .ml.cmo:
 
 .ml.cmo:
-       $(OCAMLC) $(OCAMLCFLAGS) -c $< -o $@
+       $(OCAMLC) -I $(srcdir) $(OCAMLCFLAGS) -c $< -o $@
 
 .mli.cmi:
 
 .mli.cmi:
-       $(OCAMLC) $(OCAMLCFLAGS) -c $< -o $@
+       $(OCAMLC) -I $(srcdir) $(OCAMLCFLAGS) -c $< -o $@
 
 depend: .depend
 
 
 depend: .depend
 
index 5813f84..7028fa4 100644 (file)
@@ -53,16 +53,16 @@ mlguestfs.cmxa: $(XOBJS)
        $(OCAMLMKLIB) -o mlguestfs $^ -L$(top_builddir)/src/.libs -lguestfs
 
 guestfs_c.o: guestfs_c.c
        $(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
 
 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
 
 
 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
        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,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
 
 
 depend: .depend