Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: XS60E002
Fetching contributors…

Cannot retrieve contributors at this time

181 lines (144 sloc) 5.067 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
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)
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
CLEAN_OBJS = *.cmi *.cmo *.cmx *.cma *.cmxa *.annot *.run *.opt *.o *.a
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= generate_constants autogen_idl
OCAML_PHASE2= $(if $(BYTE_ENABLED), ocaml/idl/ocaml_backend/xapi_client.cma) $(if $(NATIVE_ENABLED), ocaml/idl/ocaml_backend/xapi_client.cmxa)
# 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 \
ocaml/xapi/xapi_unit_test \
ocaml/xstest/xstest \
ocaml/xstest/xsbench \
ocaml/xstest/xscheckperms \
allxenops \
ocaml/xenguest/xenguest \
ocaml/xenguest/dumpcore \
ocaml/xiu/libxenctrl_xiu.so \
ocaml/xiu/xiu \
ocaml/xapi/fakeguestagent \
ocaml/xapi/quicktestbin \
ocaml/xapi/sparse_dd \
ocaml/xapi/monitor_fake_plugin \
ocaml/license/v6d \
ocaml/license/v6d-reopen-logs
OCAML_PHASE3_NOXEN = \
ocaml/ptoken/genptoken \
ocaml/auth/testauthx \
ocaml/xe-cli/xe \
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/idl/html_build \
ocaml/db_process/xapi-db-process \
ocaml/vncproxy/vncproxy \
ocaml/xapi/rrddump \
ocaml/perftest/perftest \
ocaml/perftest/histogram \
ocaml/perftest/cumulative_time \
ocaml/lvhdrt/lvhdrt \
ocaml/mpathalert/mpathalert \
ocaml/multipathrt/multipathrt
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)
Jump to Line
Something went wrong with that request. Please try again.