]> xenbits.xensource.com Git - xcp/xen-api-libs.git/commitdiff
[packaging] separate the normal Makefile from the one used to build the components...
authorThomas Gazagnaire <thomas.gazagnaire@citrix.com>
Wed, 11 Nov 2009 17:41:47 +0000 (17:41 +0000)
committerThomas Gazagnaire <thomas.gazagnaire@citrix.com>
Wed, 11 Nov 2009 17:41:47 +0000 (17:41 +0000)
Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
21 files changed:
Makefile
camldm/Makefile
cdrom/Makefile
close-and-exec/Makefile
eventchn/Makefile
http-svr/Makefile
log/Makefile
mk/Makefile
mmap/Makefile
pciutil/Makefile
rpc-light/Makefile
rss/Makefile
sexpr/Makefile
stdext/Makefile
stunnel/Makefile
uuid/Makefile
xb/Makefile
xc/Makefile
xml-light2/Makefile
xs/Makefile
xsrpc/Makefile

index 78a75a3e6abef6477e8f60809e676aefbf5c7194..40bf8c4370972922a86796e075f8c9db70c8dbe1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,4 @@
-NO_DEFAULT_BUILD := yes
-ifdef B_BASE
-include $(B_BASE)/common.mk
-else
-MY_OUTPUT_DIR ?= $(CURDIR)/output
-MY_OBJ_DIR ?= $(CURDIR)/obj
-
-%/.dirstamp:
-       @mkdir -p $*
-       @touch $@
-endif
-
+.PHONY: all
 all:
        $(MAKE) -C uuid
        $(MAKE) -C camldm
@@ -25,7 +14,8 @@ all:
        $(MAKE) -C close-and-exec
        $(MAKE) -C sexpr
 
-allxen:
+.PHONY: allxen
+allxen: all
        $(MAKE) -C mmap
        $(MAKE) -C xc
        $(MAKE) -C xb
@@ -100,49 +90,6 @@ binuninstall:
        $(MAKE) -C stdext binuninstall
        $(MAKE) -C close-and-exec binuninstall
 
-OUTPUT_API_PKG := $(MY_OUTPUT_DIR)/api-libs.tar.gz
-
-$(OUTPUT_API_PKG): DESTDIR=$(MY_OBJ_DIR)/staging/
-$(OUTPUT_API_PKG): PREFIX=$(shell ocamlfind printconf path)
-$(OUTPUT_API_PKG): $(MY_OBJ_DIR)/.dirstamp $(MY_OUTPUT_DIR)/.dirstamp
-       rm -rf $(DESTDIR)
-       mkdir -p $(DESTDIR)$(PREFIX)
-       mkdir -p $(DESTDIR)$(LIBEXEC)
-       $(MAKE) clean
-       $(MAKE) all
-       $(MAKE) DESTDIR=$(MY_OBJ_DIR)/staging install
-       $(MAKE) bins
-       $(MAKE) DESTDIR=$(MY_OBJ_DIR)/staging bininstall
-       tar -C $(DESTDIR) -zcf $@ .
-
-OUTPUT_XAPI_PKG := $(MY_OUTPUT_DIR)/xapi-libs.tar.gz
-
-$(OUTPUT_XAPI_PKG): DESTDIR=$(MY_OBJ_DIR)/staging/
-$(OUTPUT_XAPI_PKG): PREFIX=$(shell ocamlfind printconf path)
-$(OUTPUT_XAPI_PKG): $(MY_OBJ_DIR)/.dirstamp $(MY_OUTPUT_DIR)/.dirstamp
-       rm -rf $(DESTDIR)
-       mkdir -p $(DESTDIR)$(PREFIX)
-       $(MAKE) cleanxen
-       $(MAKE) allxen
-       $(MAKE) DESTDIR=$(MY_OBJ_DIR)/staging installxen
-       tar -C $(DESTDIR) -zcf $@ .
-
-OUTPUT_SRC := $(MY_OUTPUT_DIR)/xen-api-libs-src.tar.bz2
-
-$(MY_SOURCES)/MANIFEST: $(MY_SOURCES_DIRSTAMP) $(OUTPUT_SRC)
-       echo api lgpl-with-linking-exception file $(OUTPUT_SRC) > $@
-
-$(OUTPUT_SRC):
-       cd $(REPO) && hg archive -t tbz2 $(HG_EXCLUDE) $@
-
-.PHONY: api-libs
-api-libs: $(OUTPUT_API_PKG) $(MY_SOURCES)/MANIFEST
-       @ :
-
-.PHONY: xapi-libs
-xapi-libs: $(OUTPUT_XAPI_PKG) $(MY_SOURCES)/MANIFEST
-       @ :
-       
 .PHONY: doc
 doc:
        $(MAKE) -C uuid doc
@@ -180,7 +127,6 @@ clean:
        make -C close-and-exec clean
        make -C sexpr clean
        make -C doc clean
-       rm -f $(OUTPUT_API_PKG)
 
 cleanxen:
        $(MAKE) -C mmap clean
@@ -189,4 +135,5 @@ cleanxen:
        $(MAKE) -C xs clean
        $(MAKE) -C xsrpc clean
        $(MAKE) -C eventchn clean
-       rm -f $(OUTPUT_XAPI_PKG)
+
+
index c83d1452dcb209a4aedea567bebae67724ef5ef8..ce2c79fb86a0e4722afa30ce3618b10ef63c0579 100644 (file)
@@ -1,4 +1,3 @@
-
 CC = gcc
 CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml
 OCAMLC = ocamlc -g
@@ -6,7 +5,6 @@ OCAMLOPT = ocamlopt
 
 LDFLAGS = -cclib -L./
 
-DESTDIR ?= /
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
 OCAMLOPTFLAGS = -g -dtypes
 
@@ -55,8 +53,10 @@ META: META.in
        sed 's/@VERSION@/$(VERSION)/g' < $< > $@
 
 .PHONY: install
+install: path = $(DESTDIR)$(shell ocamlfind printconf destdir)
 install: $(LIBS) META
-       ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore camldm META $(INTF) $(LIBS) *.a *.so *.cmx
+       mkdir -p $(path)
+       ocamlfind install -destdir $(path) -ldconf ignore camldm META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
index b84afd6e1270b744250c0201ca36edb03b84ee86..23c08c48e9f15c6b95fd5af7c421fd52725bf337 100644 (file)
@@ -5,7 +5,6 @@ OCAMLOPT = ocamlopt
 
 LDFLAGS = -cclib -L./
 
-DESTDIR ?= /
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
 OCAMLOPTFLAGS = -g -dtypes
 
@@ -54,8 +53,10 @@ META: META.in
        sed 's/@VERSION@/$(VERSION)/g' < $< > $@
 
 .PHONY: install
+install: path = $(DESTDIR)$(shell ocamlfind printconf destdir)
 install: $(LIBS) META
-       ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore cdrom META $(INTF) $(LIBS) *.a *.so *.cmx
+       mkdir -p $(path)
+       ocamlfind install -destdir $(path) -ldconf ignore cdrom META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
index 447b40fcbf26b09f225c5cdd1cee0c8658693487..0834d71d0798320386d23c390da928627e40949c 100644 (file)
@@ -7,7 +7,6 @@ OCAMLOPT = ocamlopt
 LDFLAGS = -cclib -L./
 
 LIBEXEC  = "/opt/xensource/libexec"
-DESTDIR ?= /
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
 OCAMLOPTFLAGS = -g -dtypes
 
@@ -29,8 +28,8 @@ bins: $(PROGRAMS)
 
 libs: $(LIBS)
 
-closeandexec: closeandexec.cmxa all
-       $(OCAMLOPT) $(OCAMLOPTFLAGS) closeandexec.cmxa -o $@ $<
+closeandexec: closeandexec.cmxa closeandexec_main.cmx all
+       $(OCAMLOPT) $(OCAMLOPTFLAGS) -thread -I ../stdext -I ../uuid uuid.cmxa unix.cmxa threads.cmxa stdext.cmxa closeandexec.cmxa closeandexec_main.cmx -o $@ 
 
 closeandexec.cmxa: $(foreach obj,$(OBJS),$(obj).cmx)
        $(OCAMLOPT) $(OCAMLOPTFLAGS) -a -o $@ $(foreach obj,$(OBJS),$(obj).cmx)
@@ -54,13 +53,16 @@ META: META.in
        sed 's/@VERSION@/$(VERSION)/g' < $< > $@
 
 .PHONY: install
+install: path = $(DESTDIR)$(shell ocamlfind printconf destdir)
 install: $(LIBS) META
-       ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore close-and-exec META $(INTF) $(LIBS) *.a *.cmx
+       mkdir -p $(path)
+       ocamlfind install -destdir $(path) -ldconf ignore close-and-exec META $(INTF) $(LIBS) *.a *.cmx
 
 .PHONY: bininstall
-bininstall:
-       mkdir -p $(DESDIR)$(LIBEXEC)
-       $(IPROG) $(PROGRAMS) $(DESDIR)$(LIBEXEC)
+bininstall: path = $(DESTDIR)$(LIBEXEC)
+bininstall: all
+       mkdir -p $(path)
+       $(IPROG) $(PROGRAMS) $(path)
 
 .PHONY: uninstall
 uninstall:
@@ -73,6 +75,6 @@ binuninstall:
 .PHONY: doc
 doc: $(INTF)
        python ../doc/doc.py $(DOCDIR) "close-and-exec" "library" "$(OBJS)" "." "stdext" ""
-       
+
 clean:
        rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)
index 34359e4c7d447ec34237fd8860e4099bf764abbd..29d5c526ead39dc4f52548a70be496ec2ea21983 100644 (file)
@@ -5,7 +5,6 @@ OCAMLOPT = ocamlopt
 
 LDFLAGS = -cclib -L./
 
-DESTDIR ?= /
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
 OCAMLOPTFLAGS = -g -dtypes
 
@@ -54,8 +53,10 @@ META: META.in
        sed 's/@VERSION@/$(VERSION)/g' < $< > $@
 
 .PHONY: install
+install: path = $(DESTDIR)$(shell ocamlfind printconf destdir)
 install: $(LIBS) META
-       ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore eventchn META $(INTF) $(LIBS) *.a *.so *.cmx
+       mkdir -p $(path)
+       ocamlfind install -destdir $(path) -ldconf ignore eventchn META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
index 6867aab97b627fd5cbaacb8925f99936bc21929d..ec70af0dec7f7f069d4f2d4a73f0658639562119 100644 (file)
@@ -5,7 +5,6 @@ OCAMLOPT = ocamlopt
 
 LDFLAGS = -cclib -L./
 
-DESTDIR ?= /
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
 OCAMLOPTFLAGS = -g -dtypes
 
@@ -47,8 +46,10 @@ META: META.in
        sed 's/@VERSION@/$(VERSION)/g' < $< > $@
 
 .PHONY: install
+install: path = $(DESTDIR)$(shell ocamlfind printconf destdir)
 install: $(LIBS) META
-       ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore http-svr META $(INTF) $(LIBS) *.a *.cmx
+       mkdir -p $(path)
+       ocamlfind install -destdir $(path) -ldconf ignore http-svr META $(INTF) $(LIBS) *.a *.cmx
 
 .PHONY: uninstall
 uninstall:
index 48eb7c8a0a4d3b4e4d76f3a4cd698a22ef0c8281..7a9702b400a19ec281d74a94a002737789215534 100644 (file)
@@ -5,7 +5,6 @@ OCAMLOPT = ocamlopt
 
 LDFLAGS = -cclib -L./
 
-DESTDIR ?= /
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
 OCAMLCFLAGS = -g -dtypes -thread -I ../stdext
 OCAMLOPTFLAGS = -g -dtypes -thread -I ../stdext
@@ -61,8 +60,10 @@ logs.cmi: log.cmi
 debug.cmi: logs.cmi
 
 .PHONY: install
+install: path = $(DESTDIR)$(shell ocamlfind printconf destdir)
 install: $(LIBS) META
-       ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore log META $(INTF) $(LIBS) *.a *.so *.cmx
+       mkdir -p $(path)
+       ocamlfind install -destdir $(path) -ldconf ignore log META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
index e0b9806f5e6a51ce32dda6b384cb7911bd97b5a9..d7e37edbe23b493ef4d8c6d51c0df0b9c89bcf6e 100644 (file)
@@ -1,32 +1,67 @@
+NO_DEFAULT_BUILD := yes
 ifdef B_BASE
 include $(B_BASE)/common.mk
-include $(B_BASE)/rpmbuild.mk
-REPO = $(call hg_loc,xen-api-libs)
 else
-REPO ?= $(CURDIR)
+MY_OUTPUT_DIR         ?= $(CURDIR)/_build/output-devel
+MY_MAIN_PACKAGES      ?= $(CURDIR)/_build/output
+MY_OBJ_DIR            ?= $(CURDIR)/_build/obj
+MY_SOURCES            ?= $(CURDIR)/_build/output-src
+MY_SOURCES_DIRSTAMP   ?= $(MY_SOURCES)/.dirstamp
+
 %/.dirstamp:
        @mkdir -p $*
        @touch $@
 endif
 
-RPM_BINDIR=$(RPM_RPMSDIR)/$(DOMAIN0_ARCH_OPTIMIZED)
+REPO                   = $(call hg_loc,xen-api-libs)
+STAGING               ?= $(MY_OBJ_DIR)/staging
+OUTPUT_API_DEVEL_PKG  ?= $(MY_OUTPUT_DIR)/api-libs-devel.tar.gz
+OUTPUT_XAPI_DEVEL_PKG ?= $(MY_OUTPUT_DIR)/xapi-libs-devel.tar.gz
+OUTPUT_API_PKG        ?= $(MY_MAIN_PACKAGES)/api-libs.tar.bz2
+OUTPUT_SRC            ?= $(MY_SOURCES)/xen-api-libs-src.tar.bz2
+
+$(OUTPUT_API_DEVEL_PKG):
+       rm -rf $(STAGING)
+       mkdir -p $(MY_OUTPUT_DIR)
+       $(MAKE) -C $(REPO) clean
+       $(MAKE) -C $(REPO) all
+       $(MAKE) -C $(REPO) DESTDIR=$(STAGING) install
+       tar -C $(STAGING) -zcf $@ .
 
-.PHONY: build
-build: srpm $(MY_SOURCES)/MANIFEST
-       $(RPMBUILD) --target $(DOMAIN0_ARCH_OPTIMIZED) -bb $(RPM_SPECSDIR)/xapi-libs.spec
+$(OUTPUT_API_PKG): $(OUTPUT_API_DEVEL_PKG)
+       rm -rf $(STAGING)
        mkdir -p $(MY_MAIN_PACKAGES)
-       cp $(RPM_RPMSDIR)/$(DOMAIN0_ARCH_OPTIMIZED)/xapi-libs-fe-*.rpm $(MY_MAIN_PACKAGES)
+       $(MAKE) -C $(REPO) bins
+       $(MAKE) -C $(REPO) DESTDIR=$(STAGING) bininstall
+       tar -C $(STAGING) -jcf $@ .
+
+$(OUTPUT_XAPI_DEVEL_PKG):
+       rm -rf $(STAGING)
+       mkdir -p $(MY_OUTPUT_DIR)
+       $(MAKE) -C $(REPO) cleanxen
+       $(MAKE) -C $(REPO) allxen
+       $(MAKE) -C $(REPO) DESTDIR=$(STAGING) installxen
+       tar -C $(STAGING) -zcf $@ .
+
+$(MY_SOURCES)/MANIFEST: $(MY_SOURCES_DIRSTAMP) $(OUTPUT_SRC)
+       mkdir -p $(MY_SOURCES)
+       echo api lgpl-with-linking-exception file $(OUTPUT_SRC) > $@
+
+$(OUTPUT_SRC):
+       mkdir -p $(MY_SOURCES)
+       cd $(REPO) && hg archive -t tbz2 $(HG_EXCLUDE) $@
 
-.PHONY: srpm
-srpm:
-       mkdir -p $(RPM_SRPMSDIR) $(RPM_SPECSDIR) $(RPM_SOURCESDIR) $(RPM_RPMSDIR)
-       hg archive -p xapi-libs-0 -t tbz2 $(RPM_SOURCESDIR)/xapi-libs-0.tar.bz2
-       install -o root -g root ../xapi-libs.spec $(RPM_SPECSDIR)
-       $(RPMBUILD) --target $(DOMAIN0_ARCH_OPTIMIZED) -bs $(RPM_SPECSDIR)/xapi-libs.spec
+.PHONY: api-libs
+api-libs: $(OUTPUT_API_DEVEL_PKG) $(OUTPUT_API_PKG) $(MY_SOURCES)/MANIFEST
 
-$(MY_SOURCES)/MANIFEST: $(MY_SOURCES_DIRSTAMP)
-       rm -f $@
-       /bin/sh ./srpms-to-manifest api-libs $(MY_OUTPUT_DIR)/SRPMS > $@
+.PHONY: xapi-libs
+xapi-libs: $(OUTPUT_XAPI_DEVEL_PKG) $(MY_SOURCES)/MANIFEST
 
 .PHONY: clean
-       rm -f *.rpm
+       rm -f $(STAGING)
+       rm -f $(OUTPUT_API_DEVEL_PKG)
+       rm -f $(OUTPUT_API_PKG)
+       rm -f $(OUTPUT_XAPI_DEVEL_PKG)
+       rm -f $(OUTPUT_SRC)
+       $(MAKE) -C $(REPO) clean
+       $(MAKE) -C $(REPO) cleanxen
index 8701f3f191c237532997ebcc57cd47ef5dbbb4f0..076372d731722b0db00d13098696e80c52e43340 100644 (file)
@@ -5,7 +5,6 @@ OCAMLOPT = ocamlopt
 
 LDFLAGS = -cclib -L./
 
-DESTDIR ?= /
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
 OCAMLOPTFLAGS = -g -dtypes
 
@@ -54,8 +53,10 @@ META: META.in
        sed 's/@VERSION@/$(VERSION)/g' < $< > $@
 
 .PHONY: install
+install: path = $(DESTDIR)$(shell ocamlfind printconf destdir)
 install: $(LIBS) META
-       ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore mmap META $(INTF) $(LIBS) *.a *.so *.cmx
+       mkdir -p $(path)
+       ocamlfind install -destdir $(path) -ldconf ignore mmap META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
index 19976251261c9dfde76a15c219ed6e840b43d20b..f05b29e2e10c59b3e9246fcf6032e2ca3943ca5a 100644 (file)
@@ -7,7 +7,6 @@ OCAMLOPT = ocamlopt
 LDFLAGS = -cclib -L./
 
 LIBEXEC = "/opt/xensource/libexec"
-DESTDIR ?= /
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
 OCAMLOPTFLAGS = -g -dtypes
 
@@ -54,13 +53,16 @@ META: META.in
        sed 's/@VERSION@/$(VERSION)/g' < $< > $@
 
 .PHONY: install
+install: path = $(DESTDIR)$(shell ocamlfind printconf destdir)
 install: $(LIBS) META
-       ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore pciutil META $(INTF) $(LIBS) *.a *.cmx
+       mkdir -p $(path)
+       ocamlfind install -destdir $(path) -ldconf ignore pciutil META $(INTF) $(LIBS) *.a *.cmx
 
 .PHONY: bininstall
-bininstall:
-       mkdir -p $(DESDIR)$(LIBEXEC)
-       $(IPROG) $(PROGRAMS) $(DESDIR)$(LIBEXEC)
+bininstall: path = $(DESTDIR)$(LIBEXEC)
+bininstall: all
+       mkdir -p $(path)
+       $(IPROG) $(PROGRAMS) $(path)
 
 .PHONY: uninstall
 uninstall:
index 6e53f5fe3c0c0e618761ffb4e999b62a96549536..f134a5fb0827f1dc21aa0b2da6e878019f795d19 100644 (file)
@@ -56,13 +56,15 @@ jsonrpc.cmi: jsonrpc.mli rpc.ml
 
 
 .PHONY: install
+install: path = $(DESTDIR)$(shell ocamlfind printconf destdir)
 install: rpc.cmi pa_rpc.cma xmlrpc.cma xmlrpc.cmxa
+       mkdir -p $(path)
        cp META-xmlrpc META
-       ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) xmlrpc META xmlrpc.cma xmlrpc.cmxa xmlrpc.cmi rpc.cmi xmlrpc.cmx rpc.cmx xmlrpc.a xmlrpc.o
+       ocamlfind install -destdir $(path) xmlrpc META xmlrpc.cma xmlrpc.cmxa xmlrpc.cmi rpc.cmi xmlrpc.cmx rpc.cmx xmlrpc.a xmlrpc.o
        cp META-jsonrpc META
-       ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) jsonrpc META jsonrpc.cma jsonrpc.cmxa jsonrpc.cmi rpc.cmi jsonrpc.cmx rpc.cmx jsonrpc.a jsonrpc.o
+       ocamlfind install -destdir $(path) jsonrpc META jsonrpc.cma jsonrpc.cmxa jsonrpc.cmi rpc.cmi jsonrpc.cmx rpc.cmx jsonrpc.a jsonrpc.o
        cp META-rpc-light META
-       ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) rpc-light META pa_rpc.cma pa_rpc.cmi
+       ocamlfind install -destdir $(path) rpc-light META pa_rpc.cma pa_rpc.cmi
        rm META
 
 .PHONY: uninstall
index 5260e745c5f8a2eac9d3f430df3fcb73c2acf9c1..e0c28a113caa5a675a7124974654a8b6397c29d2 100644 (file)
@@ -5,7 +5,6 @@ OCAMLOPT = ocamlopt
 
 LDFLAGS = -cclib -L./
 
-DESTDIR ?= /
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
 OCAMLOPTFLAGS = -g -dtypes
 
@@ -47,8 +46,10 @@ META: META.in
        sed 's/@VERSION@/$(VERSION)/g' < $< > $@
 
 .PHONY: install
+install: path = $(DESTDIR)$(shell ocamlfind printconf destdir)
 install: $(LIBS) META
-       ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore rss META $(INTF) $(LIBS) *.a *.cmx
+       mkdir -p $(path)
+       ocamlfind install -destdir $(path) -ldconf ignore rss META $(INTF) $(LIBS) *.a *.cmx
 
 .PHONY: uninstall
 uninstall:
index 9cab04f3647a58511cb88e7ed8ed578edfbfcf86..69db4ee3080a1000a5b6685d97bd41b2c06bfa08 100644 (file)
@@ -9,7 +9,6 @@ OCAMLYACC = ocamlyacc
 LDFLAGS = -cclib -L./
 
 LIBEXEC  = "/opt/xensource/libexec"
-DESTDIR ?= /
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
 OCAMLOPTFLAGS = -g -dtypes
 
@@ -68,13 +67,16 @@ META: META.in
        sed 's/@VERSION@/$(VERSION)/g' < $< > $@
 
 .PHONY: install
+install: path = $(DESTDIR)$(shell ocamlfind printconf destdir)
 install: $(LIBS) META
-       ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore sexpr META $(INTF) $(LIBS) *.a *.cmx
+       mkdir -p $(path)
+       ocamlfind install -destdir $(path) -ldconf ignore sexpr META $(INTF) $(LIBS) *.a *.cmx
 
 .PHONY: bininstall
-bininstall:
-       mkdir -p $(DESDIR)$(LIBEXEC)
-       $(IPROG) $(PROGRAMS) $(DESDIR)$(LIBEXEC)
+bininstall: path = $(DESTDIR)$(LIBEXEC)
+bininstall: all
+       mkdir -p $(path)
+       $(IPROG) $(PROGRAMS) $(path)
 
 .PHONY: uninstall
 uninstall:
index fed4fd9096649651b069c0708c6b2f788a7ca9bc..3aef421756f5d6e3f2158f6aad44361e807608ff 100644 (file)
@@ -8,7 +8,6 @@ OCAMLOPT = ocamlopt
 LDFLAGS = -cclib -L./
 
 LIBEXEC = "/opt/xensource/libexec/"
-DESTDIR ?= /
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
 OCAMLOPTFLAGS = -g -dtypes
 
@@ -29,7 +28,7 @@ LIBS = stdext.cma stdext.cmxa
 PROGRAMS = base64pp
 
 DOCDIR = /myrepos/xen-api-libs.hg/doc
-       
+
 all: $(INTF) $(LIBS)
 
 bins: $(PROGRAMS)
@@ -100,13 +99,16 @@ META: META.in
        sed 's/@VERSION@/$(VERSION)/g' < $< > $@
 
 .PHONY: install
+install: path = $(DESTDIR)$(shell ocamlfind printconf destdir)
 install: $(LIBS) META
-       ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore stdext META $(INTF) $(LIBS) *.a *.so *.cmx
+       mkdir -p $(path)
+       ocamlfind install -destdir $(path) -ldconf ignore stdext META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: bininstall
-bininstall:
-       mkdir -p $(DESDIR)$(LIBEXEC)
-       $(IPROG) $(PROGRAMS) $(DESDIR)$(LIBEXEC)
+bininstall: path = $(DESTDIR)$(LIBEXEC)
+bininstall: all
+       mkdir -p $(path)
+       $(IPROG) $(PROGRAMS) $(path)
 
 .PHONY: uninstall
 uninstall:
index 3dc049ddad08b001aef964645d6803a7b50669be..66665aa73d6a52ed1cb2e78b9ba634500d00012e 100644 (file)
@@ -5,7 +5,6 @@ OCAMLOPT = ocamlopt
 
 LDFLAGS = -cclib -L./
 
-DESTDIR ?= /
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
 OCAMLOPTFLAGS = -g -dtypes
 
@@ -47,8 +46,10 @@ META: META.in
        sed 's/@VERSION@/$(VERSION)/g' < $< > $@
 
 .PHONY: install
+install: path = $(DESTDIR)$(shell ocamlfind printconf destdir)
 install: $(LIBS) META
-       ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore stunnel META $(INTF) $(LIBS) *.a *.cmx
+       mkdir -p $(path)
+       ocamlfind install -destdir $(path) -ldconf ignore stunnel META $(INTF) $(LIBS) *.a *.cmx
 
 .PHONY: uninstall
 uninstall:
index 0e273d01d90ebe894e073cbde836d127f9f5a095..d7eb4f9921acf3f22f8451a86eb8a2a52797bfd0 100644 (file)
@@ -5,7 +5,6 @@ OCAMLOPT = ocamlopt
 
 LDFLAGS = -cclib -L./
 
-DESTDIR ?= /
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
 OCAMLOPTFLAGS = -g -dtypes
 
@@ -47,8 +46,10 @@ META: META.in
        sed 's/@VERSION@/$(VERSION)/g' < $< > $@
 
 .PHONY: install
+install: path = $(DESTDIR)$(shell ocamlfind printconf destdir)
 install: $(LIBS) META
-       ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore uuid META $(INTF) $(LIBS) *.a *.cmx
+       mkdir -p $(path)
+       ocamlfind install -destdir $(path) -ldconf ignore uuid META $(INTF) $(LIBS) *.a *.cmx
 
 .PHONY: uninstall
 uninstall:
index 3707e1b8c576a5c53de694a17be30247e661e37c..f3888d151a7f4e864e0d1d56e4b1c53dc68b8ab0 100644 (file)
@@ -6,7 +6,6 @@ OCAMLOPTFLAGS = -g -dtypes -I ../mmap
 
 LDFLAGS = -cclib -L./
 
-DESTDIR ?= /
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
 
 OCAMLABI := $(shell ocamlc -version)
@@ -60,8 +59,10 @@ META: META.in
        sed 's/@VERSION@/$(VERSION)/g' < $< > $@
 
 .PHONY: install
+install: path = $(DESTDIR)$(shell ocamlfind printconf destdir)
 install: $(LIBS) META
-       ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore xb META $(INTF) $(LIBS) *.a *.so *.cmx
+       mkdir -p $(path)
+       ocamlfind install -destdir $(path) -ldconf ignore xb META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
index 24eba3238704304fa72bbc5ab2239eb8e4ef75ce..e95d51a43405a2560d8b319452fa568238769033 100644 (file)
@@ -6,7 +6,6 @@ OCAMLOPTFLAGS = -g -dtypes -I ../mmap -I ../uuid
 
 LDFLAGS = -cclib -L./
 
-DESTDIR ?= /
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
 
 OCAMLABI := $(shell ocamlc -version)
@@ -54,8 +53,10 @@ META: META.in
        sed 's/@VERSION@/$(VERSION)/g' < $< > $@
 
 .PHONY: install
+install: path = $(DESTDIR)$(shell ocamlfind printconf destdir)
 install: $(LIBS) META
-       ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore xc META $(INTF) $(LIBS) *.a *.so *.cmx
+       mkdir -p $(path)
+       ocamlfind install -destdir $(path) -ldconf ignore xc META $(INTF) $(LIBS) *.a *.so *.cmx
 
 .PHONY: uninstall
 uninstall:
index d45c8ae200e1ae442e6fe4df53df62ce506a5c46..ee4464683e7b7d16a0e5e857a2560e8deb6a41cc 100644 (file)
@@ -13,7 +13,6 @@ OCAMLOPT = $(OCAMLFIND) ocamlopt $(OCAMLFINDFLAGS)
 LDFLAGS = -cclib -L./
 
 LIBEXEC  = "/opt/xensource/libexec"
-DESTDIR ?= /
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
 OCAMLOPTFLAGS = -g -dtypes
 
@@ -59,13 +58,16 @@ META: META.in
        sed 's/@VERSION@/$(VERSION)/g' < $< > $@
 
 .PHONY: install
+install: path = $(DESTDIR)$(shell ocamlfind printconf destdir)
 install: $(LIBS) META
-       ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore xml-light2 META $(INTF) $(LIBS) *.a *.cmx
+       mkdir -p $(path)
+       ocamlfind install -destdir $(path) -ldconf ignore xml-light2 META $(INTF) $(LIBS) *.a *.cmx
 
 .PHONY: bininstall
-bininstall:
-       mkdir -p $(DESDIR)$(LIBEXEC)
-       $(IPROG) $(PROGRAMS) $(DESDIR)$(LIBEXEC)
+bininstall: path = $(DESTDIR)$(LIBEXEC)
+bininstall: all
+       mkdir -p $(path)
+       $(IPROG) $(PROGRAMS) $(path)
 
 .PHONY: uninstall
 uninstall:
index 74086d0a350d3b27283763e6fa93a3935c0b3f4a..5c7f623093929669b0b8a647e1e0d976657663b3 100644 (file)
@@ -5,7 +5,6 @@ OCAMLOPT = ocamlopt
 
 LDFLAGS = -cclib -L./
 
-DESTDIR ?= /
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
 OCAMLOPTFLAGS = -g -dtypes -I ../xb/
 
@@ -50,8 +49,10 @@ META: META.in
        sed 's/@VERSION@/$(VERSION)/g' < $< > $@
 
 .PHONY: install
+install: path = $(DESTDIR)$(shell ocamlfind printconf destdir)
 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 $(path)
+       ocamlfind install -destdir $(path) -ldconf ignore xs META $(INTF) xs.mli xst.mli xsraw.mli $(LIBS) *.a *.cmx
 
 .PHONY: uninstall
 uninstall:
index 0d9e9daf003656d113af485820b311d2e006f554..3800b82fd56166e2482cba454007284d0d5f7206 100644 (file)
@@ -5,7 +5,6 @@ OCAMLOPT = ocamlopt
 
 LDFLAGS = -cclib -L./
 
-DESTDIR ?= /
 VERSION := $(shell hg parents --template "{rev}" 2>/dev/null || echo 0.0)
 OCAMLOPTFLAGS = -g -dtypes -I ../xb/ -I ../xs/
 
@@ -47,8 +46,10 @@ META: META.in
        sed 's/@VERSION@/$(VERSION)/g' < $< > $@
 
 .PHONY: install
+install: path = $(DESTDIR)$(shell ocamlfind printconf destdir)
 install: $(LIBS) META
-       ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore xsrpc META $(INTF) $(LIBS) *.a *.cmx
+       mkdir -p $(path)
+       ocamlfind install -destdir $(path) -ldconf ignore xsrpc META $(INTF) $(LIBS) *.a *.cmx
 
 .PHONY: uninstall
 uninstall: