Skip to content

Commit

Permalink
Merge pull request #64 from djs55/jbuilder
Browse files Browse the repository at this point in the history
Switch to jbuilder
  • Loading branch information
djs55 authored May 30, 2017
2 parents 8b25247 + 2301cea commit 6fcd002
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 8,499 deletions.
11 changes: 3 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
_build/
setup.bin
setup.data
setup.log
configure
config.mk
configure.cmi
configure.cmx
configure.o
*.install
*.merlin

2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ install: wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.t
script: bash -ex .travis-opam.sh
env:
global:
- PACKAGE="mirage-block-xen"
- PINS="mirage-xen"
matrix:
- OCAML_VERSION=4.04
- OCAML_VERSION=4.03
50 changes: 11 additions & 39 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,51 +1,23 @@
.PHONY: all clean install build
all: build doc

NAME=mirage-block-xen
IMAGE=$(NAME)
J=4
.PHONY: build clean test

include config.mk
config.mk: configure
./configure
build:
jbuilder build @install --dev

configure: configure.ml
ocamlfind ocamlopt -package "cmdliner,findlib" -linkpkg $< -o $@
test:
jbuilder runtest --dev

export OCAMLRUNPARAM=b

setup.bin: setup.ml
@ocamlopt.opt -o $@ $< || ocamlopt -o $@ $< || ocamlc -o $@ $<
@rm -f setup.cmx setup.cmi setup.o setup.cmo

setup.data: setup.bin
@./setup.bin -configure $(ENABLE_BLKFRONT) $(ENABLE_BLKBACK)

build: setup.data setup.bin
@./setup.bin -build -j $(J)

doc: setup.data setup.bin
@./setup.bin -doc -j $(J)

install: setup.bin
@./setup.bin -install
install:
jbuilder install

uninstall:
@ocamlfind remove $(NAME) || true

test: setup.bin build
@./setup.bin -test

reinstall: setup.bin
@ocamlfind remove $(NAME) || true
@./setup.bin -reinstall
jbuilder uninstall

xen-depends: Dockerfile build.sh
docker build -t $(IMAGE) .
docker build -t mirage-block-xen .

xen-build: xen-depends clean
docker run -v $(shell pwd):/src $(IMAGE) /build.sh
docker run -v $(shell pwd):/src mirage-block-xen /build.sh

clean:
@ocamlbuild -clean
@rm -f setup.data setup.log setup.bin
rm -rf _build
37 changes: 0 additions & 37 deletions _oasis

This file was deleted.

39 changes: 0 additions & 39 deletions _tags

This file was deleted.

50 changes: 0 additions & 50 deletions configure.ml

This file was deleted.

1 change: 0 additions & 1 deletion lib/blkproto.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)

open Lwt
open Printf

type ('a, 'b) result = [
Expand Down
24 changes: 24 additions & 0 deletions lib/jbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
(library
((name mirage_block_xen)
(public_name mirage-block-xen)
(modules (Blkproto Device_number))
(libraries (cstruct cstruct.ppx io-page))
(wrapped false)
(preprocess (pps (cstruct.ppx)))
))

(library
((name mirage_block_xen_front)
(public_name mirage-block-xen.front)
(modules (Blkfront Block))
(libraries (logs stringext lwt cstruct cstruct.ppx mirage-block-lwt io-page shared-memory-ring shared-memory-ring-lwt mirage-block-xen xen-evtchn xen-gnt mirage-xen))
(wrapped false)
))

(library
((name mirage_block_xen_back)
(public_name mirage-block-xen.back)
(modules (Blkback Block_request))
(libraries (logs lwt cstruct cstruct.ppx io-page shared-memory-ring shared-memory-ring-lwt mirage-block-xen xen-evtchn xen-gnt xenstore mirage-block-lwt rresult))
(wrapped false)
))
16 changes: 10 additions & 6 deletions opam → mirage-block-xen.opam
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,28 @@ tags: [
"org:mirage"
"org:xapi-project"
]
build: [ [make] ]
install: [ [make "install" "BINDIR=%{bin}%"] ]
remove: [ [make "uninstall" "BINDIR=%{bin}%"] ]

build: [
[ "jbuilder" "subst"] {pinned}
[ "jbuilder" "build" "-p" name "-j" jobs ]
]

depends: [
"ocamlfind"
"ocamlfind" {build}
"jbuilder" {build & >="1.0+beta9"}
"cmdliner"
"logs"
"stringext"
"lwt" {>= "2.4.3"}
"cstruct" {>= "1.9.0"}
"ppx_tools"
"shared-memory-ring" {>= "0.4.1"}
"shared-memory-ring-lwt"
"mirage-block-lwt" {>= "1.0.0"}
"ipaddr"
"io-page" {>= "1.4.0"}
"mirage-xen" {>= "1.0.1" }
"rresult"
]
available: [
ocaml-version >= "4.02.0" & os = "linux"
ocaml-version >= "4.02.0"
]
Loading

0 comments on commit 6fcd002

Please sign in to comment.