Skip to content

Commit

Permalink
Tweak Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
tmattio committed Jul 2, 2021
1 parent e2b4249 commit dde4204
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
.DEFAULT_GOAL := all

ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(ARGS):;@:)

.PHONY: all
all:
opam exec -- dune build --root . @install

.PHONY: deps
deps: ## Install development dependencies
opam pin -n -y [email protected]:ocaml/ocaml-lsp.git
opam pin -n -y [email protected]:aantron/dream.git
opam install -y dune-release merlin ocamlformat utop ocaml-lsp-server
npm install
opam install -y dune-release ocamlformat utop ocaml-lsp-server
opam install --deps-only --with-test --with-doc -y .

.PHONY: create_switch
create_switch:
opam switch create . 4.12.0 --no-install
opam switch create . --no-install

.PHONY: switch
switch: create_switch deps ## Create an opam switch and install development dependencies
Expand All @@ -34,9 +28,9 @@ build: ## Build the project, including non installable libraries and executables
install: all ## Install the packages on the system
opam exec -- dune install --root .

.PHONY: start
start: all ## Run the produced executable
opam exec -- dune exec --root . bin/server.exe $(ARGS)
.PHONY: example
example: all ## Run the produced executable
opam exec -- dune exec --root . example/server.exe

.PHONY: test
test: ## Run the unit tests
Expand Down

0 comments on commit dde4204

Please sign in to comment.