2016-02-19 16:36:03 -08:00
|
|
|
# Portions Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
2016-03-03 07:59:12 +01:00
|
|
|
|
2016-05-22 01:23:48 +03:00
|
|
|
SHELL=bash -o pipefail
|
2025-10-21 16:43:46 +08:00
|
|
|
ESY-DUNE=esy dune
|
|
|
|
|
OPAM-DUNE=opam exec -- dune
|
|
|
|
|
|
|
|
|
|
# Use dune from opam if _opam folder exists, otherwise use dune from esy
|
|
|
|
|
ifneq ($(wildcard _opam),)
|
|
|
|
|
DUNE=$(OPAM-DUNE)
|
|
|
|
|
else
|
|
|
|
|
DUNE=$(ESY-DUNE)
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
.PHONY: help
|
|
|
|
|
help: ## Print this help message
|
|
|
|
|
@echo "";
|
|
|
|
|
@echo "List of available make commands";
|
|
|
|
|
@echo "";
|
|
|
|
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}';
|
|
|
|
|
@echo "";
|
|
|
|
|
|
|
|
|
|
default: help
|
|
|
|
|
|
|
|
|
|
.PHONY: build
|
|
|
|
|
build: ## Build the project
|
|
|
|
|
$(DUNE) build
|
|
|
|
|
|
|
|
|
|
.PHONY: pin-reason
|
|
|
|
|
pin-reason:
|
2016-02-19 16:36:03 -08:00
|
|
|
opam pin add reason . -y
|
|
|
|
|
|
2025-10-21 16:43:46 +08:00
|
|
|
.PHONY: test
|
|
|
|
|
test: ## Run the test suite
|
|
|
|
|
$(DUNE) runtest
|
2017-11-01 14:50:32 -07:00
|
|
|
|
2025-10-21 16:43:46 +08:00
|
|
|
.PHONY: test-watch
|
|
|
|
|
test-watch: ## Run the test suite in watch mode
|
|
|
|
|
$(DUNE) runtest --watch
|
2016-02-19 16:36:03 -08:00
|
|
|
|
2018-01-31 22:13:55 +11:00
|
|
|
.PHONY: coverage
|
2025-10-21 16:43:46 +08:00
|
|
|
coverage: ## Run the test suite and generate coverage report
|
2018-01-31 22:13:55 +11:00
|
|
|
find -iname "bisect*.out" -exec rm {} \;
|
2025-10-21 16:43:46 +08:00
|
|
|
make test
|
2018-01-31 22:13:55 +11:00
|
|
|
bisect-ppx-report -ignore-missing-files -I _build/ -html coverage-after/ bisect*.out ./*/*/*/bisect*.out
|
|
|
|
|
find -iname "bisect*.out" -exec rm {} \;
|
|
|
|
|
|
2025-10-21 16:43:46 +08:00
|
|
|
.PHONY: menhir-all-errors
|
|
|
|
|
menhir-all-errors:
|
2018-05-31 07:45:47 +02:00
|
|
|
@ echo "Regenerate all the possible error states for Menhir."
|
|
|
|
|
@ echo "Warning: This will take a while and use a lot of CPU and memory."
|
|
|
|
|
@ echo "---"
|
|
|
|
|
menhir --explain --strict --unused-tokens src/reason-parser/reason_parser.mly --list-errors > src/reason-parser/reason_parser.messages.checked-in
|
|
|
|
|
|
2025-10-21 16:43:46 +08:00
|
|
|
.PHONY: clean
|
|
|
|
|
clean: ## Clean the project
|
2018-08-20 21:30:20 +01:00
|
|
|
dune clean
|
2017-11-01 01:46:19 -07:00
|
|
|
|
2025-10-21 16:43:46 +08:00
|
|
|
.PHONY: clean-for-ci
|
|
|
|
|
clean-for-ci: ## Clean the project by removing the _build directory
|
2017-10-31 23:56:41 -07:00
|
|
|
rm -rf ./_build
|
2016-02-19 16:36:03 -08:00
|
|
|
|
2025-10-21 16:43:46 +08:00
|
|
|
.PHONY: esy-prepublish
|
|
|
|
|
esy-prepublish: build ## For publishing esy releases to npm
|
2018-01-25 01:11:18 -08:00
|
|
|
node ./scripts/esy-prepublish.js
|
|
|
|
|
|
2025-10-21 16:43:46 +08:00
|
|
|
.PHONY: all-supported-ocaml-versions
|
2017-11-02 12:24:33 +08:00
|
|
|
all-supported-ocaml-versions:
|
|
|
|
|
# the --dev flag has been omitted here but should be re-introduced eventually
|
2018-08-20 21:30:20 +01:00
|
|
|
dune build @install @runtest --root .
|
2017-11-02 12:24:33 +08:00
|
|
|
|
2025-10-21 16:43:46 +08:00
|
|
|
.PHONY: doc
|
|
|
|
|
doc: ## Build the documentation
|
|
|
|
|
$(DUNE) build @doc
|
2023-04-30 21:41:33 +02:00
|
|
|
|
2025-10-21 16:43:46 +08:00
|
|
|
.PHONY: opam-create-switch
|
|
|
|
|
opam-create-switch: ## Create opam switch
|
|
|
|
|
opam switch create . 5.2.0 --deps-only --with-test --no-install
|
2023-04-30 21:41:33 +02:00
|
|
|
|
2025-10-21 16:43:46 +08:00
|
|
|
.PHONY: opam-install
|
|
|
|
|
opam-install: ## Install project dependencies
|
|
|
|
|
opam install . --deps-only --with-test --with-dev-setup --working-dir . -y
|