Fork of daniellemaywood.uk/gleam — Wasm codegen work
1#
2# Goals to be specified by user
3#
4
5.PHONY: help
6help:
7 @cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
8
9.PHONY: build
10build: ## Build the compiler
11 cargo build --release
12
13.PHONY: install
14install: ## Build the Gleam compiler and place it on PATH
15 cd gleam-bin && cargo install --path . --force --locked
16
17.PHONY: test
18test: ## Run the compiler unit tests
19 cargo test --quiet
20 cargo clippy
21 cd test/language && make
22 cd test/javascript_prelude && make test
23 cd test/project_erlang && cargo run clean && cargo run check && cargo run test
24 cd test/project_javascript && cargo run clean && cargo run check && cargo run test
25 cd test/project_deno && cargo run clean && cargo run check && cargo run test
26 cd test/hextarball && make test
27 cd test/typescript_declarations && make test
28 cd test/running_modules && make test
29 cd test/subdir_ffi && make
30
31.PHONY: snapshots-check-unused
32snapshots-check-unused: ## Check for unused cargo insta snapshots
33 cargo insta test --unreferenced=warn
34
35.PHONY: snapshots-fix-unused
36snapshots-fix-unused: ## Remove unused cargo insta snapshots
37 cargo insta test --unreferenced=delete
38
39.PHONY: language-test
40language-test: ## Run the language integration tests for all targets
41 cd test/language && make
42
43.PHONY: language-test-watch
44language-test-watch: ## Run the language integration tests for all targets when files change
45 watchexec "cd test/language && make"
46
47.PHONY: javascript-prelude-test
48javascript-prelude-test: ## Run the JavaScript prelude core tests
49 cd test/javascript_prelude && make test
50
51.PHONY: javascript-prelude-test-watch
52javascript-prelude-test-watch: ## Run the JavaScript prelude core tests when files change
53 watchexec "cd test/javascript_prelude && make test"
54
55.PHONY: test-watch
56test-watch: ## Run compiler tests when files change
57 watchexec -e rs,toml,gleam,html "cargo test --quiet"
58
59.PHONY: export-hex-tarball-test
60export-hex-tarball-test: ## Run `gleam export hex-tarball` and verify it is created
61 cd test/hextarball && make test
62
63.PHONY: typescript-declarations-test
64typescript-declarations-test: ## Check that generated TypeScript declaration compile
65 cd test/typescript_declarations && make test
66
67.PHONY: benchmark
68benchmark: ## Run the benchmarks
69 cd benchmark/list && make
70
71# Debug print vars with `make print-VAR_NAME`
72print-%: ; @echo $*=$($*)