@@ -182,27 +182,47 @@ test-rewatch: lib
182182
183183test-all : test test-gentype test-analysis test-tools test-rewatch
184184
185- # Builds the core playground bundle (without the relevant cmijs files for the runtime)
186- playground : | $(YARN_INSTALL_STAMP )
187- dune build --profile browser
188- cp -f ./_build/default/compiler/jsoo/jsoo_playground_main.bc.js packages/playground/compiler.js
185+ # Playground
186+
187+ PLAYGROUND_BUILD_DIR := ./_build_playground
188+ PLAYGROUND_BUILD_STAMP := $(PLAYGROUND_BUILD_DIR ) /log # touched by dune on each build
189+ PLAYGROUND_COMPILER := packages/playground/compiler.js
190+ PLAYGROUND_CMI_BUILD_STAMP := packages/playground/.buildstamp # touched by playground npm build script
191+
192+ playground : playground-compiler playground-cmijs
193+
194+ playground-compiler : $(PLAYGROUND_COMPILER )
195+
196+ $(PLAYGROUND_COMPILER ) : $(PLAYGROUND_BUILD_STAMP )
197+
198+ $(PLAYGROUND_BUILD_STAMP ) : $(COMPILER_SOURCES )
199+ dune build --profile browser --build-dir $(PLAYGROUND_BUILD_DIR )
200+ cp -f $(PLAYGROUND_BUILD_DIR ) /default/compiler/jsoo/jsoo_playground_main.bc.js $(PLAYGROUND_COMPILER )
189201
190202# Creates all the relevant core and third party cmij files to side-load together with the playground bundle
191- playground-cmijs : | $(YARN_INSTALL_STAMP ) # should also depend on artifacts, but that causes an attempt to copy binaries for JSOO
203+ playground-cmijs : $(PLAYGROUND_CMI_BUILD_STAMP )
204+
205+ $(PLAYGROUND_CMI_BUILD_STAMP ) : $(RUNTIME_BUILD_STAMP ) $(NINJA_EXE )
192206 yarn workspace playground build
193207
208+ playground-test : playground
209+ yarn workspace playground test
210+
194211# Builds the playground, runs some e2e tests and releases the playground to the
195212# Cloudflare R2 (requires Rclone `rescript:` remote)
196- playground-release : playground playground-cmijs | $(YARN_INSTALL_STAMP )
197- yarn workspace playground test
213+ playground-release : playground-test
198214 yarn workspace playground upload-bundle
199215
216+ # Format
217+
200218format : | $(YARN_INSTALL_STAMP )
201219 ./scripts/format.sh
202220
203221checkformat : | $(YARN_INSTALL_STAMP )
204222 ./scripts/format_check.sh
205223
224+ # Clean
225+
206226clean-gentype :
207227 make -C tests/gentype_tests/typescript-react-example clean
208228 make -C tests/gentype_tests/stdlib-no-shims clean
@@ -216,4 +236,4 @@ dev-container:
216236
217237.DEFAULT_GOAL := build
218238
219- .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
239+ .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-compiler playground-test playground- cmijs playground-release format checkformat clean-ninja clean-rewatch clean-compiler clean-lib clean-gentype clean-tests clean dev-container
0 commit comments