Skip to content
Newer
Older
100644 196 lines (166 sloc) 5.52 KB
2a259dd fix build Signed-off-by: David Scott <dave.scott@eu.citrix.com>
David Scott authored Jan 26, 2011
1 ifdef B_BASE
2 include $(B_BASE)/common.mk
3 include $(B_BASE)/rpmbuild.mk
58322bf @zli Update to use the new macro name after discussion with Peter
zli authored Jan 23, 2012
4 REPO=$(call git_loc,xen-api)
2a259dd fix build Signed-off-by: David Scott <dave.scott@eu.citrix.com>
David Scott authored Jan 26, 2011
5 else
6 MY_OUTPUT_DIR ?= $(CURDIR)/output
7 MY_OBJ_DIR ?= $(CURDIR)/obj
8 REPO ?= $(CURDIR)
9
e1304e9 @zli Xen 4.1: Query rpm to find build directories.
zli authored Mar 14, 2011
10 RPM_SPECSDIR?=$(shell rpm --eval='%_specdir')
11 RPM_SRPMSDIR?=$(shell rpm --eval='%_srcrpmdir')
12 RPM_SOURCESDIR?=$(shell rpm --eval='%_sourcedir')
2a259dd fix build Signed-off-by: David Scott <dave.scott@eu.citrix.com>
David Scott authored Jan 26, 2011
13 RPMBUILD?=rpmbuild
14 XEN_RELEASE?=unknown
15 endif
16
e696eb8 @rokstrnisa Added auto-generated config_constants.ml, and made use of it.
rokstrnisa authored Jul 5, 2011
17 BASE_PATH=$(shell scripts/base-path scripts/xapi.conf)
a5eae39 @rokstrnisa Making use of base_path in Makefile and xapi.spec.in.
rokstrnisa authored Jul 5, 2011
18
810891b @jonludlam EA-1012: Fix the xapi rpm such that it builds using mock
jonludlam authored Feb 10, 2011
19 JQUERY=$(CARBON_DISTFILES)/javascript/jquery/jquery-1.1.3.1.pack.js
20 JQUERY_TREEVIEW=$(CARBON_DISTFILES)/javascript/jquery/treeview/jquery.treeview.zip
21
07b0071 Allow bytecode compile with 'COMPILE_BYTE=yes make'
Mike McClurg authored Jul 18, 2012
22 COMPILE_NATIVE ?= yes
23 COMPILE_BYTE ?= no
66f6008 Move defaults for environment variables PRODUCT_VERSION, PRODUCT_BRAN…
David Scott authored Jan 26, 2011
24 export COMPILE_NATIVE COMPILE_BYTE
f77e728 Initial import of hg.uk.xensource.com/carbon/trunk/api.hg c/s 9691:9a…
Xen hg user authored Jun 6, 2009
25
4ae1883 @jonludlam Make a file fhs.ml containing important paths that will change as par…
jonludlam authored Nov 29, 2011
26 # FHS stuff
27 VARDIR=/var/xapi
28 VARPATCHDIR=/var/patch
29 ETCDIR=/etc/xensource
30 OPTDIR=/opt/xensource
31 PLUGINDIR=/etc/xapi.d/plugins
32 HOOKSDIR=/etc/xapi.d
33 INVENTORY=/etc/xensource-inventory
34 XAPICONF=/etc/xapi.conf
17e0edd @rokstrnisa rrdd: Now parsing /etc/xcp-rrdd.conf.
rokstrnisa authored Jun 30, 2012
35 RRDDCONF=/etc/xcp-rrdd.conf
13b8348 @jonludlam Move everything over to using Fhs.ml / @ substitution
jonludlam authored Dec 6, 2011
36 LIBEXECDIR=/opt/xensource/libexec
4ae1883 @jonludlam Make a file fhs.ml containing important paths that will change as par…
jonludlam authored Nov 29, 2011
37 SCRIPTSDIR=/etc/xensource/scripts
13b8348 @jonludlam Move everything over to using Fhs.ml / @ substitution
jonludlam authored Dec 6, 2011
38 SHAREDIR=/opt/xensource
39 WEBDIR=/opt/xensource/www
40 XHADIR=/opt/xensource/xha
41 BINDIR=/opt/xensource/bin
fbb0e3e @jonludlam Move over to using SBINDIR for installing xapi
jonludlam authored Dec 8, 2011
42 SBINDIR=/opt/xensource/bin
4ae1883 @jonludlam Make a file fhs.ml containing important paths that will change as par…
jonludlam authored Nov 29, 2011
43
17e0edd @rokstrnisa rrdd: Now parsing /etc/xcp-rrdd.conf.
rokstrnisa authored Jun 30, 2012
44 export VARDIR ETCDIR OPTDIR PLUGINDIR HOOKSDIR INVENTORY VARPATCHDIR LIBEXECDIR XAPICONF RRDDCONF SCRIPTSDIR SHAREDIR WEBDIR XHADIR BINDIR SBINDIR
4ae1883 @jonludlam Make a file fhs.ml containing important paths that will change as par…
jonludlam authored Nov 29, 2011
45
f77e728 Initial import of hg.uk.xensource.com/carbon/trunk/api.hg c/s 9691:9a…
Xen hg user authored Jun 6, 2009
46 .PHONY: all
13b8348 @jonludlam Move everything over to using Fhs.ml / @ substitution
jonludlam authored Dec 6, 2011
47 all: version ocaml/fhs.ml
8f99f39 Bump omake job count
Mike McClurg authored Apr 2, 2012
48 omake -j 8 phase1
49 omake -j 8 phase2
50 omake -j 8 phase3
f3d5111 make all always runs unit tests (build fails if tests fail)
Mike McClurg authored Jul 6, 2012
51 @make test
f77e728 Initial import of hg.uk.xensource.com/carbon/trunk/api.hg c/s 9691:9a…
Xen hg user authored Jun 6, 2009
52
53 .PHONY: phase3
54 phase3:
55 omake phase3
56
4ab6b5c [xenopsd]: build the "make test" target as part of the RPM build
David Scott authored Jan 2, 2012
57 .PHONY: test
58 test:
59 omake test
1d52636 Add more tests to test target
Mike McClurg authored Jul 6, 2012
60 @echo @
61 @echo @ Running unit tests
62 @echo @
63 # Pipe ugly bash output to /dev/null
64 @echo @ xapi unit test suite
65 @./ocaml/test/suite
66 @echo @ xapi_unit_test
67 @./ocaml/xapi/xapi_unit_test
68 @echo @ xenops-cli unit test
f3d5111 make all always runs unit tests (build fails if tests fail)
Mike McClurg authored Jul 6, 2012
69 @./ocaml/xenops-cli/runtest.sh 2> /dev/null
70 @echo
1d52636 Add more tests to test target
Mike McClurg authored Jul 6, 2012
71 @echo @ HA binpack test
72 @./ocaml/xapi/binpack
73 @echo @ squeezed test
74 @./ocaml/xenops/squeeze_test
75 # The following test no longer runs:
76 # ./ocaml/database/database_test
77 # The following test no longer compiles:
78 # ./ocaml/xenops/device_number_test
79 # The following test must be run in dom0:
80 # ./ocaml/xenops/cancel_utils_test
4ab6b5c [xenopsd]: build the "make test" target as part of the RPM build
David Scott authored Jan 2, 2012
81
f77e728 Initial import of hg.uk.xensource.com/carbon/trunk/api.hg c/s 9691:9a…
Xen hg user authored Jun 6, 2009
82 .PHONY: install
83 install:
84 omake install
7053f43 Remove "stresstest" target from the Makefile since the binary is gone.
David Scott authored Apr 7, 2011
85 omake lib-uninstall
86 omake lib-install
f77e728 Initial import of hg.uk.xensource.com/carbon/trunk/api.hg c/s 9691:9a…
Xen hg user authored Jun 6, 2009
87
5c2c88e [packaging] make a xapi-client library usable with ocmalfind.
Thomas Gazagnaire authored Nov 11, 2009
88 .PHONY: lib-install
89 lib-install:
90 omake DESTDIR=$(DESTDIR) lib-install
91
92 .PHONY: lib-uninstall
93 lib-uninstall:
1a7822f @robhoes Ensure that the xapi-client library is uninstalled from the right pla…
robhoes authored Jun 17, 2010
94 omake DESTDIR=$(DESTDIR) lib-uninstall
5c2c88e [packaging] make a xapi-client library usable with ocmalfind.
Thomas Gazagnaire authored Nov 11, 2009
95
f77e728 Initial import of hg.uk.xensource.com/carbon/trunk/api.hg c/s 9691:9a…
Xen hg user authored Jun 6, 2009
96 .PHONY: sdk-install
1518b8c @robhoes Docs: remove old HTML docs (sorry Dave)
robhoes authored Nov 22, 2011
97 sdk-install: doc
f77e728 Initial import of hg.uk.xensource.com/carbon/trunk/api.hg c/s 9691:9a…
Xen hg user authored Jun 6, 2009
98 omake sdk-install
99
06be7e4 [build] Make a separate noarch.spec.in for noarch RPMs
David Scott authored May 31, 2012
100 .PHONY: noarch-install
101 noarch-install: doc
102 omake noarch-install
103
f77e728 Initial import of hg.uk.xensource.com/carbon/trunk/api.hg c/s 9691:9a…
Xen hg user authored Jun 6, 2009
104 .PHONY: clean
105 clean:
106 omake clean
5c2c88e [packaging] make a xapi-client library usable with ocmalfind.
Thomas Gazagnaire authored Nov 11, 2009
107 omake lib-uninstall
f77e728 Initial import of hg.uk.xensource.com/carbon/trunk/api.hg c/s 9691:9a…
Xen hg user authored Jun 6, 2009
108 rm -rf dist/staging
e696eb8 @rokstrnisa Added auto-generated config_constants.ml, and made use of it.
rokstrnisa authored Jul 5, 2011
109 rm -f .omakedb .omakedb.lock xapi.spec
f77e728 Initial import of hg.uk.xensource.com/carbon/trunk/api.hg c/s 9691:9a…
Xen hg user authored Jun 6, 2009
110
111 .PHONY: otags
112 otags:
113 otags -vi -r . -o tags
114
115 .PHONY: doc
d4f0660 @rokstrnisa 'make doc' now removes the need for the rebuild-doc script.
rokstrnisa authored Jul 14, 2010
116 doc: api-doc api-libs-doc
117
118 .PHONY: api-doc
407785e @robhoes Clean up doc target of Makefile
robhoes authored Jan 26, 2011
119 api-doc: version
d4f0660 @rokstrnisa 'make doc' now removes the need for the rebuild-doc script.
rokstrnisa authored Jul 14, 2010
120 omake phase1 phase2 # autogenerated files might be required
f77e728 Initial import of hg.uk.xensource.com/carbon/trunk/api.hg c/s 9691:9a…
Xen hg user authored Jun 6, 2009
121 omake doc
d4f0660 @rokstrnisa 'make doc' now removes the need for the rebuild-doc script.
rokstrnisa authored Jul 14, 2010
122
123 .PHONY: api-libs-doc
124 api-libs-doc:
c0ec114 @matthiasgoergens convert mentions of hg to git
matthiasgoergens authored Jan 31, 2011
125 @(cd ../xen-api-libs 2> /dev/null && $(MAKE) doc) || \
d4f0660 @rokstrnisa 'make doc' now removes the need for the rebuild-doc script.
rokstrnisa authored Jul 14, 2010
126 (echo ">>> If you have a myclone of xen-api-libs, its documentation will be included. <<<")
127
f26f23c @robhoes Set the default platform version to 0.0.0
robhoes authored Feb 23, 2012
128 PLATFORM_VERSION ?= 0.0.0
129
3fd0b92 Move the generation of ocaml/util/version.ml into the Makefile so tha…
David Scott authored May 28, 2010
130 .PHONY: version
131 version:
ad16031 Remove last bit of spam from "make"
David Scott authored Apr 7, 2011
132 @printf "(* This file is autogenerated. Grep for e17512ce-ba7c-11df-887b-0026b9799147 (random uuid) to see where it comes from. ;o) *) \n \
fe7f60f Globally change hg_id to git_id
Mike McClurg authored Nov 29, 2011
133 let git_id = \"$(shell git show-ref --head | grep -E ' HEAD$$' | cut -f 1 -d ' ')\" \n \
f96cf24 @matthiasgoergens version.ml and marking
matthiasgoergens authored Feb 2, 2011
134 let hostname = \"$(shell hostname)\" \n \
135 let date = \"$(shell date -u +%Y-%m-%d)\" \n \
85e5254 @johnelse EA-1012: Fix Host.software_version for XCP.
authored Nov 24, 2011
136 let product_version = Util_inventory.lookup ~default:\"\" \"PRODUCT_VERSION\" \n \
137 let product_version_text = Util_inventory.lookup ~default:\"\" \"PRODUCT_VERSION_TEXT\" \n \
138 let product_version_text_short = Util_inventory.lookup ~default:\"\" \"PRODUCT_VERSION_TEXT_SHORT\" \n \
e354074 @johnelse EA-1012: Hardcode PLATFORM_NAME/PLATFORM_VERSION.
authored Nov 29, 2011
139 let platform_name = \"$(PLATFORM_NAME)\" \n \
140 let platform_version = \"$(PLATFORM_VERSION)\" \n \
85e5254 @johnelse EA-1012: Fix Host.software_version for XCP.
authored Nov 24, 2011
141 let product_brand = Util_inventory.lookup ~default:\"\" \"PRODUCT_BRAND\" \n \
8701f1a Add VERSION file to set xapi version
Mike McClurg authored Nov 29, 2011
142 let build_number = Util_inventory.lookup ~default:\"$(BUILD_NUMBER)\" \"BUILD_NUMBER\" \n \
143 let xapi_version_major = $(shell cut -d. -f1 VERSION) \n \
144 let xapi_version_minor = $(shell cut -d. -f2 VERSION) \n" \
f96cf24 @matthiasgoergens version.ml and marking
matthiasgoergens authored Feb 2, 2011
145 > ocaml/util/version.ml
146
4ae1883 @jonludlam Make a file fhs.ml containing important paths that will change as par…
jonludlam authored Nov 29, 2011
147 ocaml/fhs.ml :
148 @printf "(* This file is autogenerated by xen-api.git/Makefile *)\n \
149 let vardir=\"$(VARDIR)\"\n \
150 let etcdir=\"$(ETCDIR)\"\n \
151 let optdir=\"$(OPTDIR)\"\n \
152 let plugindir=\"$(PLUGINDIR)\"\n \
153 let inventory=\"$(INVENTORY)\"\n \
154 let hooksdir=\"$(HOOKSDIR)\"\n \
155 let libexecdir=\"$(LIBEXECDIR)\"\n \
156 let xapiconf=\"$(XAPICONF)\"\n \
17e0edd @rokstrnisa rrdd: Now parsing /etc/xcp-rrdd.conf.
rokstrnisa authored Jun 30, 2012
157 let rrddconf=\"$(RRDDCONF)\"\n \
4ae1883 @jonludlam Make a file fhs.ml containing important paths that will change as par…
jonludlam authored Nov 29, 2011
158 let scriptsdir=\"$(SCRIPTSDIR)\"\n \
13b8348 @jonludlam Move everything over to using Fhs.ml / @ substitution
jonludlam authored Dec 6, 2011
159 let varpatchdir=\"$(VARPATCHDIR)\"\n \
160 let webdir=\"$(WEBDIR)\"\n \
161 let xhadir=\"$(XHADIR)\"\n \
162 let bindir=\"$(BINDIR)\"\n \
fbb0e3e @jonludlam Move over to using SBINDIR for installing xapi
jonludlam authored Dec 8, 2011
163 let sbindir=\"$(SBINDIR)\"\n \
13b8348 @jonludlam Move everything over to using Fhs.ml / @ substitution
jonludlam authored Dec 6, 2011
164 let sharedir=\"$(SHAREDIR)\"\n" \
4ae1883 @jonludlam Make a file fhs.ml containing important paths that will change as par…
jonludlam authored Nov 29, 2011
165 > ocaml/fhs.ml
17e0edd @rokstrnisa rrdd: Now parsing /etc/xcp-rrdd.conf.
rokstrnisa authored Jun 30, 2012
166
4ae1883 @jonludlam Make a file fhs.ml containing important paths that will change as par…
jonludlam authored Nov 29, 2011
167 .PHONY: clean
3fd0b92 Move the generation of ocaml/util/version.ml into the Makefile so tha…
David Scott authored May 28, 2010
168 clean:
d187dde Add RPM .spec file for xapi and associated tools.
David Scott authored May 28, 2010
169
5121f7c Set the RPM release in the spec file.
David Scott authored Apr 7, 2011
170 xapi.spec: xapi.spec.in
06be7e4 [build] Make a separate noarch.spec.in for noarch RPMs
David Scott authored May 31, 2012
171 noarch.spec: noarch.spec.in
172
173 %.spec: %.spec.in
5121f7c Set the RPM release in the spec file.
David Scott authored Apr 7, 2011
174 sed -e 's/@RPM_RELEASE@/$(shell git rev-list HEAD | wc -l)/g' < $< > $@
d6a7d77 @jonludlam Use OPTDIR rather than BASE_PATH
jonludlam authored Nov 30, 2011
175 sed -i "s!@OPTDIR@!${OPTDIR}!g" $@
d187dde Add RPM .spec file for xapi and associated tools.
David Scott authored May 28, 2010
176
177 .PHONY: srpm
06be7e4 [build] Make a separate noarch.spec.in for noarch RPMs
David Scott authored May 31, 2012
178 srpm: xapi.spec noarch.spec
d187dde Add RPM .spec file for xapi and associated tools.
David Scott authored May 28, 2010
179 mkdir -p $(RPM_SOURCESDIR) $(RPM_SPECSDIR) $(RPM_SRPMSDIR)
c0ec114 @matthiasgoergens convert mentions of hg to git
matthiasgoergens authored Jan 31, 2011
180 while ! [ -d .git ]; do cd ..; done; \
6b03d22 @matthiasgoergens add prefix for git archive
matthiasgoergens authored Feb 2, 2011
181 git archive --prefix=xapi-0.2/ --format=tar HEAD | bzip2 -z > $(RPM_SOURCESDIR)/xapi-0.2.tar.bz2 # xen-api/Makefile
06be7e4 [build] Make a separate noarch.spec.in for noarch RPMs
David Scott authored May 31, 2012
182 git archive --prefix=xapi-noarch-0.2/ --format=tar HEAD | bzip2 -z > $(RPM_SOURCESDIR)/xapi-noarch-0.2.tar.bz2 # xen-api/Makefile
810891b @jonludlam EA-1012: Fix the xapi rpm such that it builds using mock
jonludlam authored Feb 10, 2011
183 cp $(JQUERY) $(JQUERY_TREEVIEW) $(RPM_SOURCESDIR)
d187dde Add RPM .spec file for xapi and associated tools.
David Scott authored May 28, 2010
184 make -C $(REPO) version
185 rm -f $(RPM_SOURCESDIR)/xapi-version.patch
186 (cd $(REPO); diff -u /dev/null ocaml/util/version.ml > $(RPM_SOURCESDIR)/xapi-version.patch) || true
06be7e4 [build] Make a separate noarch.spec.in for noarch RPMs
David Scott authored May 31, 2012
187 cp -f xapi.spec noarch.spec $(RPM_SPECSDIR)/
188 chown root.root $(RPM_SPECSDIR)/xapi.spec $(RPM_SPECSDIR)/noarch.spec || true
d187dde Add RPM .spec file for xapi and associated tools.
David Scott authored May 28, 2010
189 $(RPMBUILD) -bs --nodeps $(RPM_SPECSDIR)/xapi.spec
06be7e4 [build] Make a separate noarch.spec.in for noarch RPMs
David Scott authored May 31, 2012
190 $(RPMBUILD) -bs --nodeps $(RPM_SPECSDIR)/noarch.spec
d187dde Add RPM .spec file for xapi and associated tools.
David Scott authored May 28, 2010
191
2a259dd fix build Signed-off-by: David Scott <dave.scott@eu.citrix.com>
David Scott authored Jan 26, 2011
192
193 .PHONY: build
194 build: all
195
Something went wrong with that request. Please try again.