Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: pr-1061-merge
Fetching contributors…

Cannot retrieve contributors at this time

230 lines (191 sloc) 6.272 kb
SCRIPTS=$(shell pwd)/scripts
IPROG=$(SCRIPTS)/install.sh 755
IDATA=$(SCRIPTS)/install.sh 644
XEN_COMPILE_ARCH = $(shell uname -m | sed -e"s/i.86/x86_32/g")
if $(equal $(XEN_COMPILE_ARCH), x86_32)
LIBDIR = lib
export
else
LIBDIR = lib64
export
# By default compile to native code but not byte code unless specified otherwise
NATIVE_ENABLED=$(getenv COMPILE_NATIVE, true)
BYTE_ENABLED=$(getenv COMPILE_BYTE, false)
if $(not $(or $(NATIVE_ENABLED), $(BYTE_ENABLED)))
eprintln(At least one of native and bytecode compilation modes should be enabled)
exit(1)
export
CARBON_DISTFILES=$(getenv CARBON_DISTFILES, /usr/groups/linux/distfiles)
export
OCAMLDEP_MODULES_ENABLED = false
USE_OCAMLFIND = true
OCAMLFLAGS = -g -dtypes -thread -warn-error +a-4-6-9-27-28-29
# c compiling stuff
OCAMLCFLAGS += -g
OCAMLOPTFLAGS = -ccopt -fPIC
CFLAGS+=-g -O2
if $(NATIVE_ENABLED)
CFLAGS+=-DCOMPILE_NATIVE
export
LDFLAGS+=-static
if $(not $(defined-env XEN_ROOT))
XEN_ROOT =
export
if $(not $(defined-env DESTDIR))
DESTDIR =
export
if $(not $(defined-env VARPATCHDIR))
VARPATCHDIR=/var/patch
export
if $(not $(defined-env ETCDIR))
ETCDIR=/etc/xensource
export
if $(not $(defined-env OPTDIR))
OPTDIR=/opt/xensource
export
if $(not $(defined-env PLUGINDIR))
PLUGINDIR=/etc/xapi.d/plugins
export
if $(not $(defined-env HOOKSDIR))
HOOKSDIR=/etc/xapi.d
export
if $(not $(defined-env INVENTORY))
INVENTORY=/etc/xensource-inventory
export
if $(not $(defined-env XAPICONF))
XAPICONF=/etc/xapi.conf
export
if $(not $(defined-env LIBEXECDIR))
LIBEXECDIR=/opt/xensource/libexec
export
if $(not $(defined-env SCRIPTSDIR))
SCRIPTSDIR=/etc/xensource/scripts
export
if $(not $(defined-env SHAREDIR))
SHAREDIR=/opt/xensource
export
if $(not $(defined-env WEBDIR))
WEBDIR=/opt/xensource/www
export
if $(not $(defined-env XHADIR))
XHADIR=/opt/xensource/xha
export
if $(not $(defined-env BINDIR))
BINDIR=/opt/xensource/bin
export
if $(not $(defined-env SBINDIR))
SBINDIR=/opt/xensource/bin
export
if $(not $(defined-env UDEVDIR))
UDEVDIR=/etc/udev
export
XEN_CFLAGS=-I$(XEN_ROOT)/usr/include
XEN_OCAML_LINK_FLAGS=-cclib -L$(XEN_ROOT)/usr/$(LIBDIR)
XEN_OCAML_CLIBS=
# For the Zurich chroot environment
CFLAGS+=-I$(shell ocamlc -where)
DIST=$(ROOT)/dist
SDK=$(DESTDIR)/usr/share/doc/xapi
SDKWWW=$(DESTDIR)/usr/share/doc/xapi/www
CLEAN_OBJS = *.cmi *.cmo *.cmx *.cma *.cmxa *.annot *.run *.opt *.o *.a *.cmt *.cmti
export CLEAN_OBJS
#.PHONY: clean
#clean:
# rm -rf doc/
COMPILE_OCAML=$(getenv COMPILE_OCAML, yes)
COMPILE_JS=$(getenv COMPILE_JS, yes)
COMPILE_JAVA=$(getenv COMPILE_JAVA, no)
PRODUCT_VERSION=$(getenv PRODUCT_VERSION, unknown)
PRODUCT_BRAND=$(getenv PRODUCT_BRAND, unknown)
BUILD_NUMBER=$(getenv BUILD_NUMBER, -1)
export
.SUBDIRS: ocaml scripts $(if $(COMPILE_JAVA), java) $(if $(COMPILE_JS), javascript)
export
.PHONY: none
# Ocaml #############################################################################
OCAML_PHASE1= autogen_idl
OCAML_PHASE2= \
$(if $(BYTE_ENABLED), ocaml/idl/ocaml_backend/xapi_client.cma) $(if $(NATIVE_ENABLED), ocaml/idl/ocaml_backend/xapi_client.cmxa) \
$(if $(BYTE_ENABLED), ocaml/rrdd/rrd_client.cma) $(if $(NATIVE_ENABLED), ocaml/rrdd/rrd_client.cmxa) \
ocaml/rrdd/xcp-rrdd ocaml/rrdd/rrdd_test
# JS ################################################################################
JS_PHASE1=
JS_PHASE2=js_binding
JS_PHASE3=
# Java ##############################################################################
JAVA_PHASE1= XenServerConsole.jar
JAVA_PHASE2=
JAVA_PHASE3=
JS_PHASE1_TARGETS = $(if $(COMPILE_JS), $(JS_PHASE1))
JS_PHASE2_TARGETS = $(if $(COMPILE_JS), $(JS_PHASE2))
JS_PHASE3_TARGETS = $(if $(COMPILE_JS), $(JS_PHASE3))
JAVA_PHASE1_TARGETS = $(if $(COMPILE_JAVA), $(JAVA_PHASE1))
JAVA_PHASE2_TARGETS = $(if $(COMPILE_JAVA), $(JAVA_PHASE2))
JAVA_PHASE3_TARGETS = $(if $(COMPILE_JAVA), $(JAVA_PHASE3))
# Phase 3 targets divided into two depending on whether we're building the Xen stuff or not:
OCAML_PHASE3_XEN = \
ocaml/xapi/xapi \
allxenops \
ocaml/xenops-cli/xn \
ocaml/xenops-cli/xenopstest \
ocaml/xenops/cancel_utils_test \
ocaml/xenguest/xenguest \
ocaml/xenguest/dumpcore \
ocaml/xapi/quicktestbin \
ocaml/xapi/sparse_dd \
ocaml/xapi/storage_impl_test \
ocaml/xapi/cancel_tests \
ocaml/license/v6d \
ocaml/network/xcp-networkd \
ocaml/network/networkd_db
#ocaml/xapi/monitor_fake_plugin
OCAML_PHASE3_NOXEN = \
ocaml/ptoken/genptoken \
ocaml/auth/testauth \
ocaml/auth/testauthx \
ocaml/xe-cli/xe \
ocaml/sm-cli/sm \
ocaml/sm-cli/smtest \
ocaml/xsh/xsh \
ocaml/xe-cli/rt/test_host \
ocaml/xe-cli/rt/gtclient \
ocaml/xe-cli/rt/gtserver_linux \
ocaml/xe-cli/rt/xgetip \
ocaml/xe-cli/rt/geneva/cli_test \
ocaml/xe-cli/rt/geneva/sm_stress \
ocaml/events/event_listen \
ocaml/console/console \
ocaml/graph/graph \
ocaml/rfb/rfb_randomtest \
ocaml/database/unit_test_marshall \
ocaml/database/block_device_io \
ocaml/toplevel \
ocaml/cdrommon/cdrommon \
ocaml/xapi/binpack \
ocaml/idl/datamodel \
ocaml/db_process/xapi-db-process \
ocaml/vncproxy/vncproxy \
ocaml/perftest/perftest \
ocaml/perftest/histogram \
ocaml/perftest/cumulative_time \
ocaml/lvhdrt/lvhdrt \
ocaml/mpathalert/mpathalert \
ocaml/multipathrt/multipathrt
# ocaml/xapi/rrddump
OCAML_PHASE3 = $(OCAML_PHASE3_XEN) $(OCAML_PHASE3_NOXEN)
OCAML_PHASE1_TARGETS = $(if $(COMPILE_OCAML), $(OCAML_PHASE1))
OCAML_PHASE2_TARGETS = $(if $(COMPILE_OCAML), $(OCAML_PHASE2))
OCAML_PHASE3_TARGETS = $(if $(COMPILE_OCAML), $(OCAML_PHASE3))
#####################################################################################
# phase1: build stdlib2
.PHONY: phase1
phase1: $(OCAML_PHASE1_TARGETS) $(JS_PHASE1_TARGETS) $(JAVA_PHASE1_TARGETS)
mkdir -p $(DIST) $(DIST)/bin
# phase2: build compilers and make autogenerated files
.PHONY: phase2
phase2: $(OCAML_PHASE2_TARGETS) $(JS_PHASE2_TARGETS) $(JAVA_PHASE2_TARGETS)
# phase3: use autogenerated files to make apps
.PHONY: phase3
phase3: $(OCAML_PHASE3_TARGETS) $(JS_PHASE3_TARGETS) $(JAVA_PHASE3_TARGETS)
.PHONY: test
test: ocaml/xenops/xenopsd ocaml/xenops-cli/xenopstest ocaml/xenops-cli/runtest.sh ocaml/test/suite ocaml/database/database_test ocaml/xenops/squeeze_test
Jump to Line
Something went wrong with that request. Please try again.