Skip to content

Commit 58d4c25

Browse files
committed
update Makefile to use Dune Developer Preview
1 parent ed04c61 commit 58d4c25

File tree

1 file changed

+17
-30
lines changed

1 file changed

+17
-30
lines changed

Makefile

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,61 @@
11
.DEFAULT_GOAL := all
22

33
.PHONY: all
4-
all:
5-
opam exec -- dune build --root .
4+
all: dune.lock
5+
dune build --root .
66

7-
.PHONY: deps
8-
deps: create_switch ## Install development dependencies
9-
opam install -y ocamlformat=0.26.2 ocaml-lsp-server
10-
opam install -y --deps-only --with-test --with-doc .
11-
12-
.PHONY: create_switch
13-
create_switch: ## Create switch and pinned opam repo
14-
opam switch create . 5.2.0 --no-install --repos pin=git+https://github.com/ocaml/opam-repository#584630e7a7e27e3cf56158696a3fe94623a0cf4f
15-
16-
.PHONY: switch
17-
switch: deps ## Create an opam switch and install development dependencies
18-
19-
.PHONY: lock
20-
lock: ## Generate a lock file
21-
opam lock -y .
7+
dune.lock: ## Generate a lock file
8+
dune pkg lock
229

2310
.PHONY: build
24-
build: ## Build the project, including non installable libraries and executables
25-
opam exec -- dune build --root .
11+
build: dune.lock ## Build the project, including non installable libraries and executables
12+
dune build --root .
2613

2714
.PHONY: playground
2815
playground:
2916
make build -C playground
3017

3118
.PHONY: install
3219
install: all ## Install the packages on the system
33-
opam exec -- dune install --root .
20+
dune install --root .
3421

3522
.PHONY: start
3623
start: all ## Run the produced executable
37-
opam exec -- dune exec src/ocamlorg_web/bin/main.exe
24+
dune exec src/ocamlorg_web/bin/main.exe
3825

3926
.PHONY: test
4027
test: ## Run the unit tests
41-
opam exec -- dune build --root . @runtest
28+
dune build --root . @runtest
4229

4330
.PHONY: clean
4431
clean: ## Clean build artifacts and other generated files
45-
opam exec -- dune clean --root .
32+
dune clean --root .
4633

4734
.PHONY: doc
4835
doc: ## Generate odoc documentation
49-
opam exec -- dune build --root . @doc
36+
dune build --root . @doc
5037

5138
.PHONY: fmt
5239
fmt: ## Format the codebase with ocamlformat
53-
opam exec -- dune build --root . --auto-promote @fmt
40+
dune build --root . --auto-promote @fmt
5441

5542
.PHONY: watch
5643
watch: ## Watch for the filesystem and rebuild on every change
57-
opam exec -- dune build @run -w --force --no-buffer
44+
dune build @run -w --force --no-buffer
5845

5946
.PHONY: utop
6047
utop: ## Run a REPL and link with the project's libraries
61-
opam exec -- dune utop --root . . -- -implicit-bindings
48+
dune utop --root . . -- -implicit-bindings
6249

6350
.PHONY: scrape
6451
scrape: ## Generate the po files
65-
opam exec -- dune exec --root . tool/ood-gen/bin/scrape.exe planet
66-
opam exec -- dune exec --root . tool/ood-gen/bin/scrape.exe video
52+
dune exec --root . tool/ood-gen/bin/scrape.exe planet
53+
dune exec --root . tool/ood-gen/bin/scrape.exe video
6754

6855
.PHONY: docker
6956
docker: ## Generate docker container
7057
docker build -f Dockerfile . -t ocamlorg:latest
7158

7259
.PHONY: linkcheck
7360
linkcheck:
74-
opam exec -- dune exec --root . olinkcheck md data
61+
dune exec --root . olinkcheck md data

0 commit comments

Comments
 (0)