Permalink
Browse files

Switch the OMakefiles to using the new FHS variables

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
  • Loading branch information...
1 parent 4ae1883 commit 34d0ef000f3a27823e4ded356b32fc366a837673 @jonludlam jonludlam committed Nov 30, 2011
View
@@ -41,6 +41,9 @@ LDFLAGS+=-static
if $(not $(defined-env XEN_ROOT))
XEN_ROOT =
export
+if $(not $(defined-env DESTDIR))
+ DESTDIR =
+ export
XEN_CFLAGS=-I$(XEN_ROOT)/usr/include
XEN_OCAML_LINK_FLAGS=-cclib -L$(XEN_ROOT)/usr/$(LIBDIR)
@@ -49,14 +52,6 @@ XEN_OCAML_CLIBS=
# For the Zurich chroot environment
CFLAGS+=-I$(shell ocamlc -where)
-DESTDIR=$(getenv DESTDIR, $(ROOT)/dist/staging)
-RAW_BASE_PATH=$(shell scripts/base-path scripts/xapi.conf)
-BASE_PATH=$(DESTDIR)$(RAW_BASE_PATH)
-BIN_DIR=$(RAW_BASE_PATH)/bin
-BIN_PATH=$(DESTDIR)$(BIN_DIR)
-DEBUGDIST=$(BASE_PATH)/debug
-LIBEXEC=$(BASE_PATH)/libexec
-
DIST=$(ROOT)/dist
SDK=$(DESTDIR)/usr/share/doc/xapi
SDKWWW=$(DESTDIR)/usr/share/doc/xapi/www
View
@@ -8,6 +8,6 @@ clean:
.PHONY: install
install:
- mkdir -p $(DEBUGDIST)/www
+ mkdir -p $(DESTDIR)$(OPTDIR)/debug/www
# If we haven't built it then we can't install it (see COMPILE_JAVA)
- $(IDATA) XenServerConsole.jar $(DEBUGDIST)/www || /bin/true
+ $(IDATA) XenServerConsole.jar $(DESTDIR)$(OPTDIR)/debug/www || /bin/true
View
@@ -1,10 +1,10 @@
.PHONY: install
install:
- mkdir -p $(DEBUGDIST)/www
- cp *.js *.html *.css $(DEBUGDIST)/www
- mkdir -p $(DEBUGDIST)/www/jquery
- cp -v jquery/* $(DEBUGDIST)/www/jquery
- mkdir -p $(DEBUGDIST)/www/images
- cp -v images/xen_logo.gif $(DEBUGDIST)/www/images
+ mkdir -p $(DESTDIR)$(OPTDIR)/debug/www
+ cp *.js *.html *.css $(DESTDIR)$(OPTDIR)/debug/www
+ mkdir -p $(DESTDIR)$(OPTDIR)/debug/www/jquery
+ cp -v jquery/* $(DESTDIR)$(OPTDIR)/debug/www/jquery
+ mkdir -p $(DESTDIR)$(OPTDIR)/debug/www/images
+ cp -v images/xen_logo.gif $(DESTDIR)$(OPTDIR)/debug/www/images
View
@@ -17,4 +17,4 @@ clean:
.PHONY: install
install:
- mkdir -p $(BIN_PATH)
+ mkdir -p $(DESTDIR)$(OPTDIR)/bin
View
@@ -20,5 +20,5 @@ api_docs: custom_actions_doc
.PHONY: install
install:
- mkdir -p $(BASE_PATH)/debug
- $(IPROG) rbac_static.csv $(BASE_PATH)/debug
+ mkdir -p $(DESTDIR)$(OPTDIR)/debug
+ $(IPROG) rbac_static.csv $(DESTDIR)$(OPTDIR)/debug
View
@@ -6,8 +6,8 @@ OCamlProgram(cdrommon, cdrommon)
.PHONY: install
install:
- mkdir -p $(LIBEXEC)
- cp -f cdrommon $(LIBEXEC)
+ mkdir -p $(DESTDIR)$(LIBEXECDIR)
+ cp -f cdrommon $(DESTDIR)$(LIBEXECDIR)
.PHONY: clean
clean:
View
@@ -33,8 +33,8 @@ section:
.PHONY: install
install:
- mkdir -p $(LIBEXEC)
- $(IPROG) block_device_io $(LIBEXEC)
+ mkdir -p $(DESTDIR)$(LIBEXECDIR)
+ $(IPROG) block_device_io $(DESTDIR)$(LIBEXECDIR)
.PHONY: sdk-install
sdk-install: install
@@ -7,8 +7,8 @@ OCamlProgram(xapi-db-process, xapi_db_process)
.PHONY: install
install:
- mkdir -p $(BIN_PATH)
- cp -f xapi-db-process $(BIN_PATH)
+ mkdir -p $(DESTDIR)$(OPTDIR)/bin
+ cp -f xapi-db-process $(DESTDIR)$(OPTDIR)/bin
.PHONY: sdk-install
sdk-install: install
View
@@ -10,7 +10,7 @@ clean:
.PHONY: install
install:
- mkdir -p $(DEBUGDIST)
- $(IPROG) event_listen $(DEBUGDIST)
+ mkdir -p $(DESTDIR)$(OPTDIR)/debug
+ $(IPROG) event_listen $(DESTDIR)$(OPTDIR)/debug
View
@@ -10,7 +10,7 @@ clean:
.PHONY: install
install:
- mkdir -p $(DEBUGDIST)
- $(IPROG) graph $(DEBUGDIST)
+ mkdir -p $(DESTDIR)$(OPTDIR)/debug
+ $(IPROG) graph $(DESTDIR)$(OPTDIR)/debug
View
@@ -100,7 +100,7 @@ sdk-install: doc sdk-README.txt
META: META.in
sed 's/@VERSION@/$(PRODUCT_VERSION)/g' < $< > $@
-if $(defined DESTDIR)
+if $(defined-env DESTDIR)
INSTALL_PATH = $(DESTDIR)/$(shell ocamlfind printconf destdir)
export
else
@@ -29,5 +29,5 @@ js_binding: main
.PHONY: install
install:
- mkdir -p $(DEBUGDIST)/www
- cp api.js $(DEBUGDIST)/www
+ mkdir -p $(DESTDIR)$(OPTDIR)/debug/www
+ cp api.js $(DESTDIR)$(OPTDIR)/debug/www
@@ -152,7 +152,7 @@ clean:
META: META.in
sed 's/@VERSION@/$(PRODUCT_VERSION)/g' < $< > $@
-if $(defined DESTDIR)
+if $(defined-env DESTDIR)
INSTALL_PATH = $(DESTDIR)/$(shell ocamlfind printconf destdir)
export
else
View
@@ -22,10 +22,10 @@ OCamlProgram(v6d-reopen-logs, v6d_reopen_logs)
.PHONY: install
install: $(V6D)
- mkdir -p $(LIBEXEC)
- $(IPROG) $(V6D) $(LIBEXEC)
- mkdir -p $(BIN_PATH)
- $(IPROG) v6d-reopen-logs $(BIN_PATH)
+ mkdir -p $(DESTDIR)$(LIBEXECDIR)
+ $(IPROG) $(V6D) $(DESTDIR)$(LIBEXECDIR)
+ mkdir -p $(DESTDIR)$(OPTDIR)/bin
+ $(IPROG) v6d-reopen-logs $(DESTDIR)$(OPTDIR)/bin
.PHONY: clean
clean:
View
@@ -11,9 +11,9 @@ clean:
.PHONY: install
install:
- mkdir -p $(DEBUGDIST)
- $(IPROG) lvhdrt $(DEBUGDIST)
- mkdir -p $(DESTDIR)/etc/xapi.d/plugins
- $(IPROG) lvhdrt-helper $(DESTDIR)/etc/xapi.d/plugins/lvhdrt-helper
- $(IPROG) lvhdrt-trash-vdi $(DESTDIR)/etc/xapi.d/plugins/lvhdrt-trash-vdi
+ mkdir -p $(DESTDIR)$(OPTDIR)/debug
+ $(IPROG) lvhdrt $(DESTDIR)$(OPTDIR)/debug
+ mkdir -p $(DESTDIR)$(PLUGINDIR)
+ $(IPROG) lvhdrt-helper $(DESTDIR)$(PLUGINDIR)/lvhdrt-helper
+ $(IPROG) lvhdrt-trash-vdi $(DESTDIR)$(PLUGINDIR)/lvhdrt-trash-vdi
@@ -12,6 +12,6 @@ clean:
.PHONY: install
install:
- mkdir -p $(BIN_PATH)
- $(IPROG) mpathalert $(BIN_PATH)
+ mkdir -p $(DESTDIR)$(OPTDIR)/bin
+ $(IPROG) mpathalert $(DESTDIR)$(OPTDIR)/bin
@@ -15,7 +15,7 @@ clean:
.PHONY: install
install:
- mkdir -p $(DEBUGDIST)
- $(IPROG) multipathrt $(DEBUGDIST)
- mkdir -p $(DESTDIR)/etc/xapi.d/plugins
- $(IPROG) multipathrt-helper $(DESTDIR)/etc/xapi.d/plugins/multipathrt-helper
+ mkdir -p $(DESTDIR)$(OPTDIR)/debug
+ $(IPROG) multipathrt $(DESTDIR)$(OPTDIR)/debug
+ mkdir -p $(DESTDIR)$(PLUGINDIR)
+ $(IPROG) multipathrt-helper $(DESTDIR)$(PLUGINDIR)/multipathrt-helper
View
@@ -20,6 +20,6 @@ clean:
.PHONY: install
install:
- mkdir -p $(DEBUGDIST)
- $(IPROG) perftest $(DEBUGDIST)
+ mkdir -p $(DESTDIR)$(OPTDIR)/debug
+ $(IPROG) perftest $(DESTDIR)$(OPTDIR)/debug
View
@@ -11,8 +11,8 @@ clean:
.PHONY: install
install:
- mkdir -p $(LIBEXEC)
- $(IPROG) genptoken $(LIBEXEC)
+ mkdir -p $(DESTDIR)$(LIBEXECDIR)
+ $(IPROG) genptoken $(DESTDIR)$(LIBEXECDIR)
mkdir -p $(DIST)/genptoken-src
$(IDATA) $(GENSECRET_SRC_FILES) $(DIST)/genptoken-src
View
@@ -23,6 +23,6 @@ clean:
.PHONY: install
install:
- mkdir -p $(DEBUGDIST)
- $(IPROG) sm $(DEBUGDIST)
+ mkdir -p $(DESTDIR)$(OPTDIR)/debug
+ $(IPROG) sm $(DESTDIR)$(OPTDIR)/debug
View
@@ -1,11 +1,11 @@
-OCAML_LIBS = ../idl/ocaml_backend/common ../idl/ocaml_backend/client $(BASE_PATH)/lib/ocaml/toplevellib
+OCAML_LIBS = ../idl/ocaml_backend/common ../idl/ocaml_backend/client $(DESTDIR)$(OPTDIR)/lib/ocaml/toplevellib
OCAMLINCLUDES = ../idl/ocaml_backend/
OCAMLPACKS = xml-light2 stdext uuid
COMPILE_NATIVE=no
section
OCAMLFLAGS+=-linkall
- OCamlProgram(xencaml-bin, toplevelhelper $(BASE_PATH)/lib/ocaml/topstart )
+ OCamlProgram(xencaml-bin, toplevelhelper $(DESTDIR)$(OPTDIR)/lib/ocaml/topstart )
.PHONY: clean
View
@@ -6,8 +6,8 @@ OCamlProgram(vncproxy, vncproxy)
.PHONY: install
install:
- mkdir -p $(DEBUGDIST)
- $(IPROG) vncproxy $(DEBUGDIST)
+ mkdir -p $(DESTDIR)$(OPTDIR)/debug
+ $(IPROG) vncproxy $(DESTDIR)$(OPTDIR)/debug
.PHONY: sdk-install
sdk-install: install
View
@@ -283,25 +283,25 @@ OCamlProgram(at_least_once_more, at_least_once_more at_least_once_more_test)
generate_constants: config_constants.ml
config_constants.ml: config_constants.ml.in
- sed "s!@BASE_PATH@!\"$(RAW_BASE_PATH)\"!" $< > $@
+ sed "s!@BASE_PATH@!\"$(OPTDIR)\"!" $< > $@
.PHONY: install
install:
- mkdir -p $(BIN_PATH)
- cp -f xapi $(BIN_PATH)
- mkdir -p $(DEBUGDIST)
- $(IPROG) quicktest $(DEBUGDIST)
- cp -f quicktestbin $(DEBUGDIST)
- $(IPROG) rrddump $(DEBUGDIST)
- mkdir -p $(LIBEXEC)
- $(IPROG) sparse_dd $(LIBEXEC)
- mkdir -p $(DESTDIR)/etc/xapi.d/plugins
- $(IPROG) monitor_fake_plugin $(DESTDIR)/etc/xapi.d/plugins
+ mkdir -p $(DESTDIR)$(OPTDIR)/bin
+ cp -f xapi $(DESTDIR)$(OPTDIR)/bin
+ mkdir -p $(DESTDIR)$(OPTDIR)/debug
+ $(IPROG) quicktest $(DESTDIR)$(OPTDIR)/debug
+ cp -f quicktestbin $(DESTDIR)$(OPTDIR)/debug
+ $(IPROG) rrddump $(DESTDIR)$(OPTDIR)/debug
+ mkdir -p $(DESTDIR)$(LIBEXECDIR)
+ $(IPROG) sparse_dd $(DESTDIR)$(LIBEXECDIR)
+ mkdir -p $(DESTDIR)$(PLUGINDIR)
+ $(IPROG) monitor_fake_plugin $(DESTDIR)$(PLUGINDIR)
.PHONY: sdk-install
sdk-install: install
- mkdir -p $(LIBEXEC)
- cp fakeguestagent $(LIBEXEC)/
+ mkdir -p $(DESTDIR)$(LIBEXECDIR)
+ cp fakeguestagent $(DESTDIR)$(LIBEXECDIR)/
.PHONY: clean
clean:
View
@@ -99,13 +99,12 @@ clean:
.PHONY: install
install:
- mkdir -p $(BIN_PATH)
- $(IPROG) xe $(BIN_PATH)
+ mkdir -p $(DESTDIR)$(OPTDIR)/bin
+ $(IPROG) xe $(DESTDIR)$(OPTDIR)/bin
mkdir -p $(DESTDIR)/usr/bin
- ln -sf $(BIN_DIR)/xe $(DESTDIR)/usr/bin/xe
+ ln -sf $(OPTDIR)/bin/xe $(DESTDIR)/usr/bin/xe
mkdir -p $(DESTDIR)/etc/bash_completion.d
$(IPROG) bash-completion $(DESTDIR)/etc/bash_completion.d/xe
- mkdir -p $(DEBUGDIST)
.PHONY: sdk-install
sdk-install: install
@@ -30,5 +30,5 @@ install:
mkdir -p /tmp/cli-rt-domu/root
cp gtmessages.ml gtcomms.ml gtlinuxops.ml gtserver_linux.ml /tmp/cli-rt-domu/root
(cd $(ROOT)/scripts; /bin/sh ./make-patch /tmp/cli-rt-domu /tmp/cli-rt-domu-shar.sh)
- mv /tmp/cli-rt-domu-shar.sh $(BASE_PATH)/debug
- $(IPROG) install-debian-pv.sh install-debian-pv-inside.sh $(BASE_PATH)/debug
+ mv /tmp/cli-rt-domu-shar.sh $(DESTDIR)$(OPTDIR)/debug
+ $(IPROG) install-debian-pv.sh install-debian-pv-inside.sh $(DESTDIR)$(OPTDIR)/debug
@@ -14,8 +14,8 @@ clean:
.PHONY: install
install:
- mkdir -p $(DEBUGDIST)
- $(IPROG) cli_test sm_stress myfirstpatch.asc $(DEBUGDIST)
+ mkdir -p $(DESTDIR)$(OPTDIR)/debug
+ $(IPROG) cli_test sm_stress myfirstpatch.asc $(DESTDIR)$(OPTDIR)/debug
.PHONY: install
install:
View
@@ -21,8 +21,8 @@ clean:
.PHONY: install
install:
- mkdir -p $(LIBEXEC)
- $(IPROG) xenguest dumpcore $(LIBEXEC)
+ mkdir -p $(DESTDIR)$(LIBEXECDIR)
+ $(IPROG) xenguest dumpcore $(DESTDIR)$(LIBEXECDIR)
mkdir -p $(DIST)/xenguest-src
$(IDATA) $(XENGUEST_SRC_FILES) $(DIST)/xenguest-src
View
@@ -66,14 +66,14 @@ allxenops: $(DEBUG_PROGS) $(BIN_PROGS) $(OTHER_PROGS)
.PHONY: install
install:
- mkdir -p $(DEBUGDIST)
- cp -f $(DEBUG_PROGS) $(DEBUGDIST)
- sh -c 'for i in $(SYMLINK_PROGS); do ln -nfs xenops $(DEBUGDIST)/$$i; done'
- mkdir -p $(BIN_PATH)
- $(IPROG) $(BIN_PROGS) $(BIN_PATH)
- mkdir -p $(LIBEXEC)
- $(IPROG) fence $(LIBEXEC)/fence.bin
- $(IPROG) squeezed $(LIBEXEC)/squeezed
+ mkdir -p $(DESTDIR)$(OPTDIR)/debug
+ cp -f $(DEBUG_PROGS) $(DESTDIR)$(OPTDIR)/debug
+ sh -c 'for i in $(SYMLINK_PROGS); do ln -nfs xenops $(DESTDIR)$(OPTDIR)/debug/$$i; done'
+ mkdir -p $(DESTDIR)$(OPTDIR)/bin
+ $(IPROG) $(BIN_PROGS) $(DESTDIR)$(OPTDIR)/bin
+ mkdir -p $(DESTDIR)$(LIBEXECDIR)
+ $(IPROG) fence $(DESTDIR)$(LIBEXECDIR)/fence.bin
+ $(IPROG) squeezed $(DESTDIR)$(LIBEXECDIR)/squeezed
.PHONY: sdk-install
sdk-install: install
View
@@ -17,14 +17,14 @@ clean:
.PHONY: install
install:
- mkdir -p $(LIBEXEC)
- $(IPROG) xiu $(LIBEXEC)/
- mkdir -p $(BASE_PATH)/lib
- $(IDATA) libxenctrl_xiu.so $(BASE_PATH)/lib
+ mkdir -p $(DESTDIR)$(LIBEXECDIR)
+ $(IPROG) xiu $(DESTDIR)$(LIBEXECDIR)/
+ mkdir -p $(DESTDIR)$(OPTDIR)/lib
+ $(IDATA) libxenctrl_xiu.so $(DESTDIR)$(OPTDIR)/lib
.PHONY: sdk-install
sdk-install:
- mkdir -p $(LIBEXEC)
- $(IPROG) xiu $(LIBEXEC)/
- mkdir -p $(BASE_PATH)/lib
- $(IDATA) libxenctrl_xiu.so $(BASE_PATH)/lib
+ mkdir -p $(DESTDIR)$(LIBEXECDIR)
+ $(IPROG) xiu $(DESTDIR)$(LIBEXECDIR)/
+ mkdir -p $(DESTDIR)$(OPTDIR)/lib
+ $(IDATA) libxenctrl_xiu.so $(DESTDIR)$(OPTDIR)/lib
View
@@ -10,8 +10,8 @@ section
.PHONY: install
install:
- mkdir -p $(BIN_PATH)
- cp -f xsh $(BIN_PATH)
+ mkdir -p $(DESTDIR)$(OPTDIR)/bin
+ cp -f xsh $(DESTDIR)$(OPTDIR)/bin
clean:
rm -f *.cmi *.cmx *.cmo *.a *.cma *.cmxa *.run *.opt *.annot *.o xsh
Oops, something went wrong.

0 comments on commit 34d0ef0

Please sign in to comment.