Fork of daniellemaywood.uk/gleam — Wasm codegen work
1.8 kB
54 lines
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 compiler-cli && 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/running_modules && make test
28
29.PHONY: language-test
30language-test: ## Run the language integration tests for all targets
31 cd test/language && make
32
33.PHONY: language-test-watch
34language-test-watch: ## Run the language integration tests for all targets when files change
35 watchexec "cd test/language && make"
36
37.PHONY: javascript-prelude-test
38javascript-prelude-test: ## Run the JavaScript prelude core tests
39 cd test/javascript_prelude && make test
40
41.PHONY: javascript-prelude-test-watch
42javascript-prelude-test-watch: ## Run the JavaScript prelude core tests when files change
43 watchexec "cd test/javascript_prelude && make test"
44
45.PHONY: test-watch
46test-watch: ## Run compiler tests when files change
47 watchexec --changes-only -e rs,toml,gleam,html,capnp "cargo test --quiet"
48
49.PHONY: export-hex-tarball-test
50export-hex-tarball-test: ## Run `gleam export hex-tarball` and verify it is created
51 cd test/hextarball && make test
52
53# Debug print vars with `make print-VAR_NAME`
54print-%: ; @echo $*=$($*)