From 85d9e5bdb05dfde52d0dca51e4f349210a24011c Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Wed, 17 Oct 2018 02:24:07 -0700 Subject: [PATCH] [sledge] Add `make check` using `dune build @check` Summary: This triggers dune to build the minimum necessary to type-check and populate files merlin uses for cross-module information. Reviewed By: mbouaziz Differential Revision: D10389480 fbshipit-source-id: 1ac7e0584 --- sledge/Makefile | 23 ++++++++++------------- sledge/sledge.opam | 2 +- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/sledge/Makefile b/sledge/Makefile index 6c2b9411e..85b898585 100644 --- a/sledge/Makefile +++ b/sledge/Makefile @@ -3,8 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. +# Expected workflow is to launch `make watch` in a terminal to +# continuously rebuild when files change, and to use `make check` in +# the editor to quickly type-check and populate files used by merlin +# for cross-module information. + .PHONY: default -default: dev +default: exes DUNEINS=$(shell find src -name dune.in) DUNES=$(patsubst %.in,%,$(DUNEINS)) @@ -18,6 +23,10 @@ dunes: $(DUNES) .PHONY: setup setup: dunes +.PHONY: check +check: setup + dune build @check + .PHONY: exes exes: setup dune build _build/dev/src/sledge.exe _build/release/src/sledge.exe _build/dev/sledge.install _build/release/sledge.install @@ -26,18 +35,6 @@ exes: setup watch: setup dune build --watch _build/dev/src/sledge.exe _build/release/src/sledge.exe -.PHONY: bc -bc: setup - dune build _build/dev/src/sledge.bc - -.PHONY: dev -dev: setup - dune build _build/dev/src/sledge.exe - -.PHONY: release -release: setup - dune build _build/release/src/sledge.exe - .PHONY: test test: dune build @_build/dev/runtest --auto-promote diff --git a/sledge/sledge.opam b/sledge/sledge.opam index 5648dd1b5..fe9b6d6e5 100644 --- a/sledge/sledge.opam +++ b/sledge/sledge.opam @@ -12,7 +12,7 @@ depends: [ "core_kernel" {>= "v0.11.0"} "ctypes" "ctypes-foreign" - "dune" {build >= "1.4.0"} + "dune" {build > "1.4.0"} "llvm" {build & = "7.0.0"} "ppx_compare" {>= "v0.11.0"} "ppx_hash" {>= "v0.11.0"}