aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.hgignore1
-rw-r--r--tools/ocaml/Makefile34
-rw-r--r--tools/ocaml/common.make7
-rw-r--r--tools/ocaml/libs/Makefile16
-rw-r--r--tools/ocaml/libs/eventchn/Makefile6
-rw-r--r--tools/ocaml/libs/log/Makefile6
-rw-r--r--tools/ocaml/libs/mmap/Makefile6
-rw-r--r--tools/ocaml/libs/uuid/Makefile6
-rw-r--r--tools/ocaml/libs/xb/Makefile6
-rw-r--r--tools/ocaml/libs/xc/Makefile6
-rw-r--r--tools/ocaml/libs/xl/META.in4
-rw-r--r--tools/ocaml/libs/xl/Makefile6
-rw-r--r--tools/ocaml/libs/xs/Makefile6
-rw-r--r--tools/ocaml/xenstored/Makefile4
14 files changed, 63 insertions, 51 deletions
diff --git a/.hgignore b/.hgignore
index 865da6dc4c..3fac70041f 100644
--- a/.hgignore
+++ b/.hgignore
@@ -292,6 +292,7 @@
^tools/ioemu-dir$
^tools/ocaml/.*/.*\.annot$
^tools/ocaml/.*/.*\.cmx?a$
+^tools/ocaml/.*/META$
^tools/ocaml/.*/\.ocamldep\.make$
^tools/ocaml/xenstored/oxenstored$
^xen/\.banner.*$
diff --git a/tools/ocaml/Makefile b/tools/ocaml/Makefile
index 5171c62434..9964631e51 100644
--- a/tools/ocaml/Makefile
+++ b/tools/ocaml/Makefile
@@ -1,43 +1,19 @@
XEN_ROOT = ../..
include $(XEN_ROOT)/tools/Rules.mk
-SUBDIRS_LIBS = \
- libs/uuid libs/mmap \
- libs/log libs/xc libs/eventchn \
- libs/xb libs/xs libs/xl
-
SUBDIRS_PROGRAMS = xenstored
-SUBDIRS = $(SUBDIRS_LIBS) $(SUBDIRS_PROGRAMS)
+SUBDIRS = libs $(SUBDIRS_PROGRAMS)
.NOTPARALLEL:
# targets here must be run in order, otherwise we can try
# to build programs before the libraries are done
.PHONY: all
-all: build
-
-.PHONY: build
-build: SUBDIRS
-
-.PHONY: SUBDIRS SUBDIRS_PROGRAMS SUBDIRS_LIBS
-SUBDIRS SUBDIRS_PROGRAMS SUBDIRS_LIBS:
- @set -e; for d in $($@); do \
- echo " === building $$d"; \
- $(MAKE) --no-print-directory -C $$d; \
- done
-
-.PHONY: install install-libs install-program
-install: install-libs install-program
-
-install-program: SUBDIRS_PROGRAMS
- $(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
- $(INSTALL_PROG) xenstored/oxenstored $(DESTDIR)$(SBINDIR)
+all: subdirs-all
-install-libs: SUBDIRS_LIBS
+.PHONY: install
+install: subdirs-install
.PHONY: clean
-clean:
- @for dir in $(SUBDIRS); do \
- $(MAKE) --no-print-directory -C $$dir clean; \
- done
+clean: subdirs-clean
diff --git a/tools/ocaml/common.make b/tools/ocaml/common.make
index 064d4f67c3..f45a3e45bb 100644
--- a/tools/ocaml/common.make
+++ b/tools/ocaml/common.make
@@ -17,13 +17,8 @@ OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^ *\(-g\) .*/\1/p')
OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -cc $(CC) -w F -warn-error F
OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F
-#LDFLAGS = -cclib -L./
-
-DESTDIR ?= /
VERSION := 4.1
-OCAMLABI = $(shell $(OCAMLC) -version)
-OCAMLLIBDIR = $(shell $(OCAMLC) -where)
-OCAMLDESTDIR ?= $(OCAMLLIBDIR)
+OCAMLDESTDIR ?= $(DESTDIR)$(shell ocamlfind printconf destdir)
o= >$@.new && mv -f $@.new $@
diff --git a/tools/ocaml/libs/Makefile b/tools/ocaml/libs/Makefile
new file mode 100644
index 0000000000..2a50a31ef9
--- /dev/null
+++ b/tools/ocaml/libs/Makefile
@@ -0,0 +1,16 @@
+XEN_ROOT = ../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+SUBDIRS= \
+ uuid mmap \
+ log xc eventchn \
+ xb xs xl
+
+.PHONY: all
+all: subdirs-all
+
+.PHONY: install
+install: subdirs-install
+
+.PHONY: clean
+clean: subdirs-clean
diff --git a/tools/ocaml/libs/eventchn/Makefile b/tools/ocaml/libs/eventchn/Makefile
index 60b66f2847..ad017a1a93 100644
--- a/tools/ocaml/libs/eventchn/Makefile
+++ b/tools/ocaml/libs/eventchn/Makefile
@@ -19,11 +19,13 @@ OCAML_LIBRARY = eventchn
.PHONY: install
install: $(LIBS) META
- ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore eventchn META $(INTF) $(LIBS) *.a *.so *.cmx
+ mkdir -p $(OCAMLDESTDIR)
+ ocamlfind remove -destdir $(OCAMLDESTDIR) eventchn
+ ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore eventchn META $(INTF) $(LIBS) *.a *.so *.cmx
.PHONY: uninstall
uninstall:
- ocamlfind remove eventchn
+ ocamlfind remove -destdir $(OCAMLDESTDIR) eventchn
include $(TOPLEVEL)/Makefile.rules
diff --git a/tools/ocaml/libs/log/Makefile b/tools/ocaml/libs/log/Makefile
index 2a02629fff..f6a26d6c92 100644
--- a/tools/ocaml/libs/log/Makefile
+++ b/tools/ocaml/libs/log/Makefile
@@ -32,11 +32,13 @@ syslog.mli : syslog.ml
.PHONY: install
install: $(LIBS) META
- ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore log META $(INTF) $(LIBS) *.a *.so *.cmx
+ mkdir -p $(OCAMLDESTDIR)
+ ocamlfind remove -destdir $(OCAMLDESTDIR) log
+ ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore log META $(INTF) $(LIBS) *.a *.so *.cmx
.PHONY: uninstall
uninstall:
- ocamlfind remove log
+ ocamlfind remove -destdir $(OCAMLDESTDIR) log
include $(TOPLEVEL)/Makefile.rules
diff --git a/tools/ocaml/libs/mmap/Makefile b/tools/ocaml/libs/mmap/Makefile
index 374ef69cfd..6796d93895 100644
--- a/tools/ocaml/libs/mmap/Makefile
+++ b/tools/ocaml/libs/mmap/Makefile
@@ -18,11 +18,13 @@ OCAML_LIBRARY = mmap
.PHONY: install
install: $(LIBS) META
- ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore mmap META $(INTF) $(LIBS) *.a *.so *.cmx
+ mkdir -p $(OCAMLDESTDIR)
+ ocamlfind remove -destdir $(OCAMLDESTDIR) mmap
+ ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore mmap META $(INTF) $(LIBS) *.a *.so *.cmx
.PHONY: uninstall
uninstall:
- ocamlfind remove mmap
+ ocamlfind remove -destdir $(OCAMLDESTDIR) mmap
include $(TOPLEVEL)/Makefile.rules
diff --git a/tools/ocaml/libs/uuid/Makefile b/tools/ocaml/libs/uuid/Makefile
index 136967a9a8..509dd7c5f5 100644
--- a/tools/ocaml/libs/uuid/Makefile
+++ b/tools/ocaml/libs/uuid/Makefile
@@ -17,11 +17,13 @@ OCAML_NOC_LIBRARY = uuid
.PHONY: install
install: $(LIBS) META
- ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore uuid META $(INTF) $(LIBS) *.a *.cmx
+ mkdir -p $(OCAMLDESTDIR)
+ ocamlfind remove -destdir $(OCAMLDESTDIR) uuid
+ ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore uuid META $(INTF) $(LIBS) *.a *.cmx
.PHONY: uninstall
uninstall:
- ocamlfind remove uuid
+ ocamlfind remove -destdir $(OCAMLDESTDIR) uuid
include $(TOPLEVEL)/Makefile.rules
diff --git a/tools/ocaml/libs/xb/Makefile b/tools/ocaml/libs/xb/Makefile
index c68dc9ed94..7e583ea5d3 100644
--- a/tools/ocaml/libs/xb/Makefile
+++ b/tools/ocaml/libs/xb/Makefile
@@ -33,10 +33,12 @@ OCAML_LIBRARY = xb
.PHONY: install
install: $(LIBS) META
- ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore xb META $(INTF) $(LIBS) *.a *.so *.cmx
+ mkdir -p $(OCAMLDESTDIR)
+ ocamlfind remove -destdir $(OCAMLDESTDIR) xb
+ ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xb META $(INTF) $(LIBS) *.a *.so *.cmx
.PHONY: uninstall
uninstall:
- ocamlfind remove xb
+ ocamlfind remove -destdir $(OCAMLDESTDIR) xb
include $(TOPLEVEL)/Makefile.rules
diff --git a/tools/ocaml/libs/xc/Makefile b/tools/ocaml/libs/xc/Makefile
index b0b0bcc4ab..aca086b3d9 100644
--- a/tools/ocaml/libs/xc/Makefile
+++ b/tools/ocaml/libs/xc/Makefile
@@ -20,10 +20,12 @@ libs: $(LIBS)
.PHONY: install
install: $(LIBS) META
- ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore xc META $(INTF) $(LIBS) *.a *.so *.cmx
+ mkdir -p $(OCAMLDESTDIR)
+ ocamlfind remove -destdir $(OCAMLDESTDIR) xc
+ ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xc META $(INTF) $(LIBS) *.a *.so *.cmx
.PHONY: uninstall
uninstall:
- ocamlfind remove xc
+ ocamlfind remove -destdir $(OCAMLDESTDIR) xc
include $(TOPLEVEL)/Makefile.rules
diff --git a/tools/ocaml/libs/xl/META.in b/tools/ocaml/libs/xl/META.in
new file mode 100644
index 0000000000..9c4405a6ba
--- /dev/null
+++ b/tools/ocaml/libs/xl/META.in
@@ -0,0 +1,4 @@
+version = "@VERSION@"
+description = "Xen Toolstack Library"
+archive(byte) = "xl.cma"
+archive(native) = "xl.cmxa"
diff --git a/tools/ocaml/libs/xl/Makefile b/tools/ocaml/libs/xl/Makefile
index 2061e25a92..f04e7c740d 100644
--- a/tools/ocaml/libs/xl/Makefile
+++ b/tools/ocaml/libs/xl/Makefile
@@ -17,10 +17,12 @@ libs: $(LIBS)
.PHONY: install
install: $(LIBS) META
- ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore xl META $(INTF) $(LIBS) *.a *.so *.cmx
+ mkdir -p $(OCAMLDESTDIR)
+ ocamlfind remove -destdir $(OCAMLDESTDIR) xl
+ ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xl META $(INTF) $(LIBS) *.a *.so *.cmx
.PHONY: uninstall
uninstall:
- ocamlfind remove xl
+ ocamlfind remove -destdir $(OCAMLDESTDIR) xl
include $(TOPLEVEL)/Makefile.rules
diff --git a/tools/ocaml/libs/xs/Makefile b/tools/ocaml/libs/xs/Makefile
index 266560f1ab..31a9646f23 100644
--- a/tools/ocaml/libs/xs/Makefile
+++ b/tools/ocaml/libs/xs/Makefile
@@ -33,11 +33,13 @@ OCAML_NOC_LIBRARY = xs
.PHONY: install
install: $(LIBS) META
- ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore xs META $(INTF) xs.mli xst.mli xsraw.mli $(LIBS) *.a *.cmx
+ mkdir -p $(OCAMLDESTDIR)
+ ocamlfind remove -destdir $(OCAMLDESTDIR) xs
+ ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore xs META $(INTF) xs.mli xst.mli xsraw.mli $(LIBS) *.a *.cmx
.PHONY: uninstall
uninstall:
- ocamlfind remove xs
+ ocamlfind remove -destdir $(OCAMLDESTDIR) xs
include $(TOPLEVEL)/Makefile.rules
diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index fc351d6829..6b4697d01b 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -52,4 +52,8 @@ all: $(INTF) $(PROGRAMS)
bins: $(PROGRAMS)
+install: all
+ $(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
+ $(INSTALL_PROG) oxenstored $(DESTDIR)$(SBINDIR)
+
include $(OCAML_TOPLEVEL)/Makefile.rules