forked from xapi-project/xen-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
102 lines (85 loc) · 3.39 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
include config.mk
INSTALL_PATH = $(DESTDIR)/$(shell ocamlfind printconf destdir)
OCAMLFIND_DESTDIR = $(INSTALL_PATH)
CONFIGUREFLAGS=--enable-tests
export OCAMLFIND_DESTDIR
SETUP = ocaml setup.ml
build: setup.data
$(SETUP) -build $(BUILDFLAGS)
doc: setup.data build
$(SETUP) -doc $(DOCFLAGS)
./jsapi.native -destdir _build/ocaml/doc/html -templdir ocaml/doc/templates
cp ocaml/doc/*.js ocaml/doc/*.html ocaml/doc/*.css _build/ocaml/doc/html
./datamodel_main.native -closed -markdown -templdir ocaml/doc/templates _build/ocaml/doc/markdown
cp ocaml/doc/*.dot ocaml/doc/doc-convert.sh _build/ocaml/doc
find ocaml/doc -name "*.md" -not -name "README.md" -exec cp {} _build/ocaml/doc/markdown/ \;
test: setup.data build
$(SETUP) -test $(TESTFLAGS)
all: setup.ml
$(SETUP) -all $(ALLFLAGS)
uninstall: setup.data
$(SETUP) -uninstall $(UNINSTALLFLAGS)
reinstall: setup.data
$(SETUP) -reinstall $(REINSTALLFLAGS)
clean: setup.ml
$(SETUP) -clean $(CLEANFLAGS)
distclean: setup.ml
$(SETUP) -distclean $(DISTCLEANFLAGS)
setup.data: setup.ml
$(SETUP) -configure $(CONFIGUREFLAGS)
setup.ml: _oasis
oasis setup -setup-update dynamic
configure: setup.ml
$(SETUP) -configure $(CONFIGUREFLAGS)
.PHONY: build doc test all install uninstall reinstall clean distclean configure
rbac_static.csv: gen_api_main.native
./gen_api_main.native -mode rbac -gendebug -output rbac_static.csv
doc-json:
./gen_json.native
install: setup.data rbac_static.csv
mkdir -p $(DESTDIR)$(SBINDIR)
mkdir -p $(DESTDIR)$(OPTDIR)/bin
mkdir -p $(DESTDIR)$(LIBEXECDIR)
mkdir -p $(DESTDIR)$(OPTDIR)/debug
mkdir -p $(DESTDIR)/usr/bin
mkdir -p $(DESTDIR)/etc/bash_completion.d
mkdir -p $(INSTALL_PATH)
# ocaml/xapi
make -C scripts install
cp -f xapi_main.native $(DESTDIR)$(SBINDIR)/xapi
scripts/install.sh 755 ocaml/xapi/quicktest $(DESTDIR)$(OPTDIR)/debug
cp -f quicktest.native $(DESTDIR)$(OPTDIR)/debug/quicktestbin
scripts/install.sh 644 rbac_static.csv $(DESTDIR)$(OPTDIR)/debug
# ocaml/xsh
cp -f xsh.native $(DESTDIR)$(OPTDIR)/bin/xsh
# ocaml/xe-cli
scripts/install.sh 755 newcli.native $(DESTDIR)$(OPTDIR)/bin/xe
ln -sf $(OPTDIR)/bin/xe $(DESTDIR)/usr/bin/xe
scripts/install.sh 755 ocaml/xe-cli/bash-completion $(DESTDIR)/etc/bash_completion.d/xe
# ocaml/vncproxy
scripts/install.sh 755 vncproxy.native $(DESTDIR)$(OPTDIR)/debug/vncproxy
# ocaml/ptoken
scripts/install.sh 755 genptoken.native $(DESTDIR)$(LIBEXECDIR)/genptoken
# ocaml/perftest
scripts/install.sh 755 perftest.native $(DESTDIR)$(OPTDIR)/debug/perftest
# ocaml/mpathalert
scripts/install.sh 755 mpathalert.native $(DESTDIR)$(OPTDIR)/bin/mpathalert
# ocaml/license
scripts/install.sh 755 daily_license_check_main.native $(DESTDIR)$(LIBEXECDIR)/daily-license-check
# ocaml/graph
scripts/install.sh 755 graph.native $(DESTDIR)$(OPTDIR)/debug/graph
# ocaml/events
scripts/install.sh 755 event_listen.native $(DESTDIR)$(OPTDIR)/debug/event_listen
# ocaml/db_process
scripts/install.sh 755 xapi_db_process.native $(DESTDIR)$(OPTDIR)/bin/xapi-db-process
# ocaml/cdrommon
scripts/install.sh 755 cdrommon.native $(DESTDIR)$(LIBEXECDIR)/cdrommon
# ocaml/database
scripts/install.sh 755 block_device_io.native $(DESTDIR)$(LIBEXECDIR)/block_device_io
# Libraries
ocaml setup.ml -install
# docs
mkdir -p $(DESTDIR)$(DOCDIR)
cp -r _build/ocaml/doc/html $(DESTDIR)$(DOCDIR)
cp -r _build/ocaml/doc/markdown $(DESTDIR)$(DOCDIR)
cp _build/ocaml/doc/*.dot ocaml/doc/doc-convert.sh $(DESTDIR)$(DOCDIR)