Skip to contentSkip to conversation

ocaml: install built modules

PATCH Applied Ian Campbell 4 participants 6 messages Nov 11, 2010 – Nov 23, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocaml: install built modules

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1289489569 0
# Node ID d98249b40f3c4a41b2f1ae9dc6b09b90b323460c # Parent 566505063e89cf583633613893d2913fe56eefee
ocaml: install built modules

Previously the install target was having no effect because it ended up calling the default target in the subdir Makefile instead of the install target.

Resolve this by tying the tools/ocaml Makefiles into the generic handling done by tools/Rules.mk.

Other changes arising in one way or another from this:
- Add libs/xl/META.in
- Update .hgignore for META files
- Create leading directories
- Remove existing module before installation in install targer (worksaround what appears to be a quirk of "ocamlfind install")
- Use the globally defined $(DESTDIR)
- Move "ocamlfind printfconf destdir" to a common variable, repurposing exising unused OCAMLDESTDIR, incorporating $(DESTDIR) at the same time.
- Drop a few unused variabe definitions (mainly to avoid deciding if $(DESTDIR) made sense for them or not.
- Pass -destdir to ocamlfind in uninstall target for symmetry with install target.

.hgignore +1 -0
diff -r 566505063e89 -r d98249b40f3c .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.*$
tools/ocaml/Makefile +5 -29
diff -r 566505063e89 -r d98249b40f3c tools/ocaml/Makefile
@@ -1,43 +1,19 @@ XEN_ROOT = ../..
 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
+all: subdirs-all
 
-.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)
-
-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
tools/ocaml/common.make +1 -6
diff -r 566505063e89 -r d98249b40f3c tools/ocaml/common.make
@@ -17,13 +17,8 @@ OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt
 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= >[email protected] && mv -f [email protected] $@
tools/ocaml/libs/Makefile new file +16 -0
diff -r 566505063e89 -r d98249b40f3c 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
tools/ocaml/libs/eventchn/Makefile +4 -2
diff -r 566505063e89 -r d98249b40f3c 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
 
tools/ocaml/libs/log/Makefile +4 -2
diff -r 566505063e89 -r d98249b40f3c 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
 
tools/ocaml/libs/mmap/Makefile +4 -2
diff -r 566505063e89 -r d98249b40f3c 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
 
tools/ocaml/libs/uuid/Makefile +4 -2
diff -r 566505063e89 -r d98249b40f3c 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
 
tools/ocaml/libs/xb/Makefile +4 -2
diff -r 566505063e89 -r d98249b40f3c 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
tools/ocaml/libs/xc/Makefile +4 -2
diff -r 566505063e89 -r d98249b40f3c 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
tools/ocaml/libs/xl/META.in new file +4 -0
diff -r 566505063e89 -r d98249b40f3c tools/ocaml/libs/xl/META.in
@@ -0,0 +1,4 @@
+version = "@VERSION@"
+description = "Xen Toolstack Library"
+archive(byte) = "xl.cma"
+archive(native) = "xl.cmxa"
tools/ocaml/libs/xl/Makefile +4 -2
diff -r 566505063e89 -r d98249b40f3c 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
tools/ocaml/libs/xs/Makefile +4 -2
diff -r 566505063e89 -r d98249b40f3c 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
 
tools/ocaml/xenstored/Makefile +4 -0
diff -r 566505063e89 -r d98249b40f3c 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
#1 lore raw
Quoted 10 lines · Ian Campbell

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1289489569 0
# Node ID d98249b40f3c4a41b2f1ae9dc6b09b90b323460c # Parent 566505063e89cf583633613893d2913fe56eefee
ocaml: install built modules

Previously the install target was having no effect because it ended up calling the default target in the subdir Makefile instead of the install target.

I wondered if this change might make the .NOTPARALLEL statements unnecessary, especially in tools/ocaml/Makefile since that is now serialized due to the shape of the stuff in Rules.mk.

I sure about removing the tools/ocaml/Makefile.rules one or the ones in tools/ocaml/libs/{xs,xb}/Makefile (which may be redundant since the Makefile.rules one was added?).

Eventually I figured no harm could come from leaving them as is for now.

Quoted 296 lines

Resolve this by tying the tools/ocaml Makefiles into the generic handling done by tools/Rules.mk.

Other changes arising in one way or another from this:
- Add libs/xl/META.in
- Update .hgignore for META files
- Create leading directories
- Remove existing module before installation in install targer (worksaround what appears to be a quirk of "ocamlfind install")
- Use the globally defined $(DESTDIR)
- Move "ocamlfind printfconf destdir" to a common variable, repurposing exising unused OCAMLDESTDIR, incorporating $(DESTDIR) at the same time.
- Drop a few unused variabe definitions (mainly to avoid deciding if $(DESTDIR) made sense for them or not.
- Pass -destdir to ocamlfind in uninstall target for symmetry with install target.

diff -r 566505063e89 -r d98249b40f3c .hgignore

.hgignore Thu Nov 11 15:32:49 2010 +0000 renamed from .hgignore Thu Nov 11 15:07:42 2010 +0000 +1 -0
@@ -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 -r 566505063e89 -r d98249b40f3c tools/ocaml/Makefile

tools/ocaml/Makefile Thu Nov 11 15:32:49 2010 +0000 renamed from tools/ocaml/Makefile Thu Nov 11 15:07:42 2010 +0000 +5 -29
@@ -1,43 +1,19 @@ XEN_ROOT = ../..
 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
+all: subdirs-all
 
-.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)
-
-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 -r 566505063e89 -r d98249b40f3c tools/ocaml/common.make

tools/ocaml/common.make Thu Nov 11 15:32:49 2010 +0000 renamed from tools/ocaml/common.make Thu Nov 11 15:07:42 2010 +0000 +1 -6
@@ -17,13 +17,8 @@ OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt
 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= >[email protected] && mv -f [email protected] $@

diff -r 566505063e89 -r d98249b40f3c tools/ocaml/libs/Makefile

tools/ocaml/libs/Makefile Thu Nov 11 15:32:49 2010 +0000 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +16 -0
@@ -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 -r 566505063e89 -r d98249b40f3c tools/ocaml/libs/eventchn/Makefile

tools/ocaml/libs/eventchn/Makefile Thu Nov 11 15:32:49 2010 +0000 renamed from tools/ocaml/libs/eventchn/Makefile Thu Nov 11 15:07:42 2010 +0000 +4 -2
@@ -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 -r 566505063e89 -r d98249b40f3c tools/ocaml/libs/log/Makefile

tools/ocaml/libs/log/Makefile Thu Nov 11 15:32:49 2010 +0000 renamed from tools/ocaml/libs/log/Makefile Thu Nov 11 15:07:42 2010 +0000 +4 -2
@@ -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 -r 566505063e89 -r d98249b40f3c tools/ocaml/libs/mmap/Makefile

tools/ocaml/libs/mmap/Makefile Thu Nov 11 15:32:49 2010 +0000 renamed from tools/ocaml/libs/mmap/Makefile Thu Nov 11 15:07:42 2010 +0000 +4 -2
@@ -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 -r 566505063e89 -r d98249b40f3c tools/ocaml/libs/uuid/Makefile

tools/ocaml/libs/uuid/Makefile Thu Nov 11 15:32:49 2010 +0000 renamed from tools/ocaml/libs/uuid/Makefile Thu Nov 11 15:07:42 2010 +0000 +4 -2
@@ -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 -r 566505063e89 -r d98249b40f3c tools/ocaml/libs/xb/Makefile

tools/ocaml/libs/xb/Makefile Thu Nov 11 15:32:49 2010 +0000 renamed from tools/ocaml/libs/xb/Makefile Thu Nov 11 15:07:42 2010 +0000 +4 -2
@@ -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 -r 566505063e89 -r d98249b40f3c tools/ocaml/libs/xc/Makefile

tools/ocaml/libs/xc/Makefile Thu Nov 11 15:32:49 2010 +0000 renamed from tools/ocaml/libs/xc/Makefile Thu Nov 11 15:07:42 2010 +0000 +4 -2
@@ -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 -r 566505063e89 -r d98249b40f3c tools/ocaml/libs/xl/META.in

tools/ocaml/libs/xl/META.in Thu Nov 11 15:32:49 2010 +0000 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +4 -0
@@ -0,0 +1,4 @@
+version = "@VERSION@"
+description = "Xen Toolstack Library"
+archive(byte) = "xl.cma"
+archive(native) = "xl.cmxa"

diff -r 566505063e89 -r d98249b40f3c tools/ocaml/libs/xl/Makefile

tools/ocaml/libs/xl/Makefile Thu Nov 11 15:32:49 2010 +0000 renamed from tools/ocaml/libs/xl/Makefile Thu Nov 11 15:07:42 2010 +0000 +4 -2
@@ -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 -r 566505063e89 -r d98249b40f3c tools/ocaml/libs/xs/Makefile

tools/ocaml/libs/xs/Makefile Thu Nov 11 15:32:49 2010 +0000 renamed from tools/ocaml/libs/xs/Makefile Thu Nov 11 15:07:42 2010 +0000 +4 -2
@@ -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 -r 566505063e89 -r d98249b40f3c tools/ocaml/xenstored/Makefile

tools/ocaml/xenstored/Makefile Thu Nov 11 15:32:49 2010 +0000 renamed from tools/ocaml/xenstored/Makefile Thu Nov 11 15:07:42 2010 +0000 +4 -0
@@ -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

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
In reply to Ian Campbell
Quoted 8 lines · Ian Campbell

# HG changeset patch
# User Ian Campbell<[email protected]> # Date 1289489569 0
# Node ID d98249b40f3c4a41b2f1ae9dc6b09b90b323460c # Parent 566505063e89cf583633613893d2913fe56eefee
ocaml: install built modules

[snip]

That does looks fine globally; However there's no need to install any ocaml libraries apart from xl.

Signature · 1 line
Vincent Hanquez
#3 lore raw

Vincent Hanquez writes ("[Xen-devel] Re: [PATCH] ocaml: install built modules"):

Quoted 2 lines

That does looks fine globally; However there's no need to install any ocaml libraries apart from xl.

But is there anything wrong with doing so ?

Ian.

#4 lore raw
Quoted 5 lines · Ian Jackson

Vincent Hanquez writes ("[Xen-devel] Re: [PATCH] ocaml: install built modules"):

Quoted 2 lines

That does looks fine globally; However there's no need to install any ocaml libraries apart from xl.

But is there anything wrong with doing so ?

It actually becomes necessary as part of my "XCP: Allow XCP to use ocaml library bindings in Xen unstable" series posted last week and I included it as part of the xen-unstable part of that series.

Ian.

Applied
#5 lore raw
In reply to Ian Campbell

Ian Campbell writes ("[Xen-devel] [PATCH] ocaml: install built modules"):

Quoted 1 line

ocaml: install built modules

I have applied this patch, thanks.

Ian.