From: David Scott Date: Mon, 26 Oct 2009 16:32:15 +0000 (+0000) Subject: [refactoring] Create new targets for binary generated by components of xen-api-libs.hg X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=370bdbd94de06542875f18fce38c5d41c87acb73;p=xcp%2Fxen-api-libs.git [refactoring] Create new targets for binary generated by components of xen-api-libs.hg By default, these binaries will be installed on /opt/xensource/libexec Signed-off-by: Thomas Gazagnaire --- diff --git a/Makefile b/Makefile index 632d22f..c61ebab 100644 --- a/Makefile +++ b/Makefile @@ -84,7 +84,21 @@ bins: $(MAKE) -C xml-light2 bins $(MAKE) -C sexpr bins $(MAKE) -C stdext bins - + $(MAKE) -C close-and-exec bins + +bininstall: + $(MAKE) -C pciutil bininstall + $(MAKE) -C xml-light2 bininstall + $(MAKE) -C sexpr bininstall + $(MAKE) -C stdext bininstall + $(MAKE) -C close-and-exec bininstall + +binuninstall: + $(MAKE) -C pciutil binuninstall + $(MAKE) -C xml-light2 binuninstall + $(MAKE) -C sexpr binuninstall + $(MAKE) -C stdext binuninstall + $(MAKE) -C close-and-exec binuninstall OUTPUT_API_PKG := $(MY_OUTPUT_DIR)/api-libs.tar.gz @@ -93,9 +107,12 @@ $(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 diff --git a/close-and-exec/Makefile b/close-and-exec/Makefile index 54848ed..9c982a2 100644 --- a/close-and-exec/Makefile +++ b/close-and-exec/Makefile @@ -1,3 +1,4 @@ +IPROG=install -m 755 -o root -g root CC = gcc CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml OCAMLC = ocamlc -g @@ -5,6 +6,7 @@ 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 @@ -53,9 +55,18 @@ META: META.in install: $(LIBS) META ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore close-and-exec META $(INTF) $(LIBS) *.a *.cmx +.PHONY: bininstall +bininstall: + mkdir -p $(DESDIR)$(LIBEXEC) + $(IPROG) $(PROGRAMS) $(DESDIR)$(LIBEXEC) + .PHONY: uninstall uninstall: ocamlfind remove close-and-exec +.PHONY: binuninstall +binuninstall: + rm -f $(DESTDIR)$(LIBEXEC)$(PROGRAMS) + clean: rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS) \ No newline at end of file diff --git a/pciutil/Makefile b/pciutil/Makefile index 06aa95b..3adf0cb 100644 --- a/pciutil/Makefile +++ b/pciutil/Makefile @@ -1,3 +1,4 @@ +IPROG=install -m 755 -o root -g root CC = gcc CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml OCAMLC = ocamlc -g @@ -5,6 +6,7 @@ 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 @@ -53,9 +55,18 @@ META: META.in install: $(LIBS) META ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore pciutil META $(INTF) $(LIBS) *.a *.cmx +.PHONY: bininstall +bininstall: + mkdir -p $(DESDIR)$(LIBEXEC) + $(IPROG) $(PROGRAMS) $(DESDIR)$(LIBEXEC) + .PHONY: uninstall uninstall: ocamlfind remove pciutil +.PHONY: binuninstall +binuninstall: + rm -f $(DESTDIR)$(LIBEXEC)$(PROGRAMS) + clean: rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS) \ No newline at end of file diff --git a/rebuild b/rebuild index dabd578..2d0d72b 100755 --- a/rebuild +++ b/rebuild @@ -2,5 +2,5 @@ set -e make clean; make cleanxen; -make uninstall; make uninstallxen; -make all && make bins && make install && make allxen && make installxen +make uninstall; make uninstallxen; make binuninstall +make all && make bins && make install && make allxen && make installxen && make bininstall diff --git a/sexpr/Makefile b/sexpr/Makefile index 5bb73aa..44a0e24 100644 --- a/sexpr/Makefile +++ b/sexpr/Makefile @@ -1,3 +1,4 @@ +IPROG=install -m 755 -o root -g root CC = gcc CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml OCAMLC = ocamlc -g @@ -7,6 +8,7 @@ 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 @@ -67,9 +69,18 @@ META: META.in install: $(LIBS) META ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore sexpr META $(INTF) $(LIBS) *.a *.cmx +.PHONY: bininstall +bininstall: + mkdir -p $(DESDIR)$(LIBEXEC) + $(IPROG) $(PROGRAMS) $(DESDIR)$(LIBEXEC) + .PHONY: uninstall uninstall: ocamlfind remove sexpr +.PHONY: binuninstall +binuninstall: + rm -f $(DESTDIR)$(LIBEXEC)$(PROGRAMS) + clean: rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot sExprLexer.ml{,i} sExprParser.ml{,i} $(LIBS) $(PROGRAMS) \ No newline at end of file diff --git a/stdext/Makefile b/stdext/Makefile index c9c5cd3..d66774b 100644 --- a/stdext/Makefile +++ b/stdext/Makefile @@ -1,3 +1,4 @@ +IPROG=install -m 755 -o root -g root CC = gcc CFLAGS = -Wall -fPIC -O2 -I/opt/xensource/lib/ocaml OCAMLC = ocamlc -g @@ -5,6 +6,7 @@ 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 @@ -98,10 +100,19 @@ META: META.in install: $(LIBS) META ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore stdext META $(INTF) $(LIBS) *.a *.so *.cmx +.PHONY: bininstall +bininstall: + mkdir -p $(DESDIR)$(LIBEXEC) + $(IPROG) $(PROGRAMS) $(DESDIR)$(LIBEXEC) + .PHONY: uninstall uninstall: ocamlfind remove stdext +.PHONY: binuninstall +binuninstall: + rm -f $(DESTDIR)$(LIBEXEC)$(PROGRAMS) + clean: rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS) diff --git a/xml-light2/Makefile b/xml-light2/Makefile index 3c5447f..daa7267 100644 --- a/xml-light2/Makefile +++ b/xml-light2/Makefile @@ -1,3 +1,4 @@ +IPROG=install -m 755 -o root -g root OCAMLPACKS = xmlm CC = gcc @@ -11,6 +12,7 @@ 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 @@ -58,10 +60,19 @@ META: META.in install: $(LIBS) META ocamlfind install -destdir $(DESTDIR)$(shell ocamlfind printconf destdir) -ldconf ignore xml-light2 META $(INTF) $(LIBS) *.a *.cmx +.PHONY: bininstall +bininstall: + mkdir -p $(DESDIR)$(LIBEXEC) + $(IPROG) $(PROGRAMS) $(DESDIR)$(LIBEXEC) + .PHONY: uninstall uninstall: ocamlfind remove xml-light2 +.PHONY: binuninstall +binuninstall: + rm -f $(DESTDIR)$(LIBEXEC)$(PROGRAMS) + clean: rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot $(LIBS) $(PROGRAMS)