-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (24 loc) · 891 Bytes
/
Copy pathMakefile
File metadata and controls
37 lines (24 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
.PHONY: clean help install
.DEFAULT_GOAL = help
########################################
all: setup beautify generate test ## Do all steps
clean: ## Clean the test case
echo "Cleaning"
help: ## Show this help
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
########################################
setup: ## Setup CLI tools
python -m pip install --upgrade pip
python -m venv venv
. venv/bin/activate && \
pip install -r requirements.txt && \
pre-commit install
npm install -g js-beautify
cargo install tree-sitter-cli
beautify: ## Beautify the source files
js-beautify -r ./tree-sitter-batch/grammar.js
test: ## Run the test suite
cd tree-sitter-batch && \
CXX=g++ tree-sitter test
generate: ## Generate the parser
cd tree-sitter-batch && tree-sitter generate