1- .PHONY : all clean install build test libinstall reinstall uninstall distclean reindent
2- all : build
1+ include config.mk
32
4- NAME =xenopsd
5- J =4
3+ OPAM_PREFIX = $( DESTDIR )$( shell opam config var prefix)
4+ OPAM_LIBDIR = $( DESTDIR )$( shell opam config var lib)
65
7- ENABLE_TESTS =--enable-tests
8- COVERAGE =coverage
6+ .PHONY : build clean release test reindent install uninstall
97
10- clean :
11- @rm -f setup.data setup.log setup.bin setup.ml _oasis lib/version.ml
12- @rm -rf _build
13- @rm -f xenopsd-xc xenopsd-xenlight xenopsd-simulator xenopsd-libvirt
14- @rm -f xenopsd-xc.1 xenopsd-xenlight.1 xenopsd-simulator.1 xenopsd-libvirt.1
15- @rm -f * .native
16- @rm -f /tmp/bisect-xenops* .out || true
17- @rm -rf $(COVERAGE )
18-
19- -include config.mk
20-
21- config.mk :
22- echo Please re-run configure
23- exit 1
24-
25- setup.bin : setup.ml
26- @ocamlfind ocamlopt -o $@ -linkpkg -package oasis.dynrun setup.ml || ocamlfind ocamlc -o $@ -linkpkg -package oasis.dynrun setup.ml
27- @rm -f setup.cmi setup.cmo setup.cmx setup.o
28-
29- setup.data : setup.bin
30- @./setup.bin -configure $(ENABLE_TESTS ) $(ENABLE_XEN ) $(ENABLE_XENLIGHT ) $(ENABLE_XENGUESTBIN ) $(ENABLE_XENTOOLLOG )
8+ build :
9+ jbuilder build @install --dev
3110
32- setup.ml : _oasis.in
33- ifeq ($(BISECT_COVERAGE ) ,YES)
34- rm -f _oasis
35- sed -e 's/BuildDepends:/BuildDepends: bisect_ppx,/' _oasis.in >_oasis
36- else
37- ln -sf _oasis.in _oasis
38- endif
39- oasis setup -setup-update dynamic
40-
41- _build/config.ml : config.ml
42- @mkdir -p _build
43- @cp config.ml _build/
11+ clean :
12+ jbuilder clean
4413
45- build : setup.data setup.bin version.ml _build/config.ml
46- @./setup.bin -build -j $(J )
47- ifeq ($(ENABLE_XENLIGHT ) ,--enable-xenlight)
48- ln -sf ./xenops_xl_main.native xenopsd-xenlight
49- ./xenopsd-xenlight --help=groff > xenopsd-xenlight.1
50- endif
51- ln -sf ./xenops_simulator_main.native xenopsd-simulator
52- ./xenopsd-simulator --help=groff > xenopsd-simulator.1
53- ln -sf ./xenops_xc_main.native xenopsd-xc
54- ./xenopsd-xc --help=groff > xenopsd-xc.1
14+ release :
15+ jbuilder build @install
5516
56- test : build
57- @./setup.bin -test
17+ test :
18+ jbuilder runtest --no-buffer
5819
59- version.ml : VERSION
60- echo " let version = \" $( shell cat VERSION ) \" " > lib/version.ml
20+ reindent :
21+ git ls-files ' *.ml* ' ' **/*.ml* ' | xargs ocp-indent --syntax cstruct -i
6122
62- libinstall : build
63- @./setup.bin -install
23+ # requires odoc
24+ doc :
25+ jbuilder build @doc
6426
65- install : libinstall
27+ install :
28+ jbuilder install --prefix=$(OPAM_PREFIX ) --libdir=$(OPAM_LIBDIR ) xapi-xenopsd
6629ifeq ($(ENABLE_XENLIGHT ) ,--enable-xenlight)
67- install -D ./xenops_xl_main.native $(DESTDIR)/$(SBINDIR)/xenopsd-xenlight
68- install -D . /xenopsd-xenlight.1 $(DESTDIR)/$(MANDIR)/man1/xenopsd-xenlight.1
30+ install -D _build/install/default/bin/xenopsd-xenlight $(DESTDIR)/$(SBINDIR)/xenopsd-xenlight
31+ install -D _build/install/default/man/man1 /xenopsd-xenlight.1 $(DESTDIR)/$(MANDIR)/man1/xenopsd-xenlight.1
6932endif
70- install -D ./xenops_simulator_main.native $(DESTDIR)/$(SBINDIR)/xenopsd-simulator
71- install -D ./xenopsd-simulator.1 $(DESTDIR)/$(MANDIR)/man1/xenopsd-simulator.1
72- install -D ./xenops_xc_main.native $(DESTDIR)/$(SBINDIR)/xenopsd-xc
73- install -D ./xenopsd-xc.1 $(DESTDIR)/$(MANDIR)/man1/xenopsd-xc.1
33+ install -D _build/install/default/bin/xenopsd-simulator $(DESTDIR)/$(SBINDIR)/xenopsd-simulator
34+ install -D _build/install/default/man/man1/xenopsd-simulator.1 $(DESTDIR)/$(MANDIR)/man1/xenopsd-simulator.1
35+ install -D _build/install/default/bin/xenopsd-xc $(DESTDIR)/$(SBINDIR)/xenopsd-xc
36+ install -D _build/install/default/man/man1/xenopsd-xc.1 $(DESTDIR)/$(MANDIR)/man1/xenopsd-xc.1
37+ install -D _build/install/default/bin/set-domain-uuid $(DESTDIR)/$(LIBEXECDIR)/set-domain-uuid
7438 install -D ./scripts/vif $(DESTDIR)/$(LIBEXECDIR)/vif
7539 install -D ./scripts/vif-real $(DESTDIR)/$(LIBEXECDIR)/vif-real
7640 install -D ./scripts/block $(DESTDIR)/$(LIBEXECDIR)/block
@@ -82,20 +46,17 @@ endif
8246 install -D ./scripts/setup-pvs-proxy-rules $(DESTDIR)/$(LIBEXECDIR)/setup-pvs-proxy-rules
8347 install -D ./scripts/common.py $(DESTDIR)/$(LIBEXECDIR)/common.py
8448 install -D ./scripts/igmp_query_injector.py $(DESTDIR)/$(LIBEXECDIR)/igmp_query_injector.py
85- install -D ./set_domain_uuid.native $(DESTDIR)/$(LIBEXECDIR)/set-domain-uuid
8649 DESTDIR=$(DESTDIR) SBINDIR=$(SBINDIR) LIBEXECDIR=$(LIBEXECDIR) ETCDIR=$(ETCDIR) ./scripts/make-custom-xenopsd.conf
8750
88- reinstall : install
89- @ocamlfind remove $(NAME ) || true
90-
9151uninstall :
92- @ocamlfind remove $( NAME ) || true
52+ jbuilder uninstall --prefix= $( OPAM_PREFIX ) --libdir= $( OPAM_LIBDIR ) xapi-xenopsd
9353 rm -f $(DESTDIR ) /$(SBINDIR ) /xenopsd-xenlight
9454 rm -f $(DESTDIR ) /$(SBINDIR ) /xenopsd-xc
9555 rm -f $(DESTDIR ) /$(SBINDIR ) /xenopsd-simulator
9656 rm -f $(DESTDIR ) /$(MANDIR ) /man1/xenopsd-xenlight.1
9757 rm -f $(DESTDIR ) /$(MANDIR ) /man1/xenopsd-xc.1
98- rm -f $(DESTDIR ) /$(MANDIR ) /man1/xenopsd-simluator.1
58+ rm -f $(DESTDIR ) /$(MANDIR ) /man1/xenopsd-simulator.1
59+ rm -f $(DESTDIR ) /$(LIBEXECDIR ) /set-domain-uuid
9960 rm -f $(DESTDIR ) /$(ETCDIR ) /xenopsd.conf
10061 rm -f $(DESTDIR ) /$(LIBEXECDIR ) /vif
10162 rm -f $(DESTDIR ) /$(LIBEXECDIR ) /vif-real
@@ -109,19 +70,4 @@ uninstall:
10970 rm -f $(DESTDIR ) /$(LIBEXECDIR ) /common.py*
11071 rm -f $(DESTDIR ) /$(LIBEXECDIR ) /igmp_query_injector.py*
11172
112- .PHONY : release
113- release :
114- # remove -warn-error
115- grep -v ' warn-error' _oasis > _oasis.tmp
116- mv _oasis.tmp _oasis
117- oasis setup
118-
119- # make report - create coverage/index.html
120-
121- report :
122- bisect-ppx-report -I _build -html $(COVERAGE ) /tmp/bisect-xenops* out
123-
124- .PHONY : report
125-
126- reindent :
127- git ls-files ' *.ml' ' *.mli' | xargs ocp-indent --syntax cstruct -i
73+ .DEFAULT_GOAL := release
0 commit comments