-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (36 loc) · 1001 Bytes
/
Makefile
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
38
39
40
41
42
43
44
45
46
47
48
49
.PHONY: repl build install www hooks
git_revision != git log -1 --pretty="%h_%ad" --date=short
ldflags := -ldflags "-X 'github.com/danfragoso/milho.version=$(git_revision)'"
pwd != pwd
all: test
repl:
@go run $(ldflags) ./cli/*.go $(f)
build:
@go build $(ldflags) -o milho ./cli/*.go
install:
@cp milho /usr/bin/milho
www:
@GOOS=js GOARCH=wasm go build $(ldflags) -o www/wasm/milho.wasm www/go/milho.go
hooks:
@cp ./hooks/pre-push.milho .git/hooks/pre-push
@chmod +x .git/hooks/pre-push
test_spec:
@make build
@git clone https://github.com/milho-lang/tests
@cd tests && ./run $(pwd)/milho
@rm -rf tests
test: test_tokenizer test_parser test_interpreter test_milho test_spec
test_tokenizer:
@echo "Testing tokenizer...\n"
@go test -v ./tokenizer
@echo "\n--------"
test_parser:
@echo "Testing parser...\n"
@go test -v ./parser
@echo "\n--------"
test_interpreter:
@echo "Testing interpreter...\n"
@go test -v ./interpreter
@echo "\n--------"
test_milho:
@go test -v