@@ -45,10 +45,19 @@ DUNE_BIN_DIR = ./_build/install/default/bin
4545
4646# Build stamps
4747
48- YARN_INSTALL_STAMP := node_modules/.yarn.stamp
49- COMPILER_BUILD_STAMP := _build/.compiler.stamp
48+ # Yarn creates `.yarn/install-state.gz` whenever dependencies are installed.
49+ # Using that file as our stamp ensures manual `yarn install` runs are detected.
50+ YARN_INSTALL_STAMP := .yarn/install-state.gz
51+ # Dune updates `_build/log` for every build invocation, even when run manually.
52+ # Treat that log file as the compiler build stamp so manual `dune build`
53+ # keeps Make targets up to date.
54+ COMPILER_BUILD_STAMP := _build/log
5055RUNTIME_BUILD_STAMP := _build/.runtime.stamp
5156
57+ # Default target
58+
59+ build : compiler rewatch ninja
60+
5261# Yarn
5362
5463WORKSPACE_PACKAGE_JSONS := $(shell find packages -path '* /lib' -prune -o -name package.json -print)
@@ -58,7 +67,6 @@ yarn-install: $(YARN_INSTALL_STAMP)
5867
5968$(YARN_INSTALL_STAMP ) : $(YARN_INSTALL_SOURCES )
6069 yarn install
61- @mkdir -p $(dir $@ )
6270 touch $@
6371
6472# Ninja
@@ -133,7 +141,6 @@ lib: $(RUNTIME_BUILD_STAMP)
133141
134142$(RUNTIME_BUILD_STAMP ) : $(RUNTIME_SOURCES ) $(COMPILER_EXES ) $(RESCRIPT_EXE ) | $(YARN_INSTALL_STAMP )
135143 yarn workspace @rescript/runtime build
136- @mkdir -p $(dir $@ )
137144 touch $@
138145
139146clean-lib :
@@ -167,7 +174,7 @@ test-gentype: | $(YARN_INSTALL_STAMP)
167174 make -C tests/gentype_tests/typescript-react-example clean test
168175 make -C tests/gentype_tests/stdlib-no-shims clean test
169176
170- test-rewatch : | $(YARN_INSTALL_STAMP )
177+ test-rewatch : $( RESCRIPT_EXE ) | $(YARN_INSTALL_STAMP )
171178 ./rewatch/tests/suite-ci.sh
172179
173180test-all : test test-gentype test-analysis test-tools test-rewatch
@@ -204,6 +211,6 @@ clean: clean-lib clean-compiler clean-rewatch clean-ninja
204211dev-container :
205212 docker build -t rescript-dev-container docker
206213
207- .DEFAULT_GOAL := lib
214+ .DEFAULT_GOAL := build
208215
209- .PHONY : yarn-install ninja rewatch compiler lib artifacts bench test test-analysis test-tools test-syntax test-syntax-roundtrip test-gentype test-rewatch test-all playground playground-cmijs playground-release format checkformat clean-ninja clean-rewatch clean-compiler clean-lib clean-gentype clean-tests clean dev-container
216+ .PHONY : yarn-install build ninja rewatch compiler lib artifacts bench test test-analysis test-tools test-syntax test-syntax-roundtrip test-gentype test-rewatch test-all playground playground-cmijs playground-release format checkformat clean-ninja clean-rewatch clean-compiler clean-lib clean-gentype clean-tests clean dev-container
0 commit comments