-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
104 lines (80 loc) · 2.38 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
BINDIR = bin
all: allbin
$(BINDIR):
mkdir $@
CL_FILES = $(wildcard commonlisp/*.lisp)
CL_FASL = commonlisp/lazyk.fasl
CL_LAZYK = sbcl --script commonlisp/run-lazyk.lisp
$(CL_FASL): $(CL_FILES)
$(CL_LAZYK) make
.PHONY: commonlisp test-unit-commonlisp test-commonlisp
commonlisp: $(CL_FASL)
test-unit-commonlisp: $(CL_FASL)
$(CL_LAZYK) test
test-commonlisp: $(CL_FASL)
sh run_tests.sh $(CL_LAZYK) run
CS_FILES = $(wildcard csharp/lazyk-cs/*.cs*)
CS_BIN = $(BINDIR)/cslazyk
$(CS_BIN): $(BINDIR) $(CS_FILES)
cd csharp && make && cp publish/lazyk-cs ../$(CS_BIN)
.PHONY: csharp test-unit-csharp test-csharp
csharp: $(CS_BIN)
test-unit-csharp:
cd csharp && make test
test-csharp: $(CS_BIN)
sh run_tests.sh $(CS_BIN)
GO_FILES = $(wildcard go/*.go) $(wildcard go/cmd/*.go)
GO_BIN = $(BINDIR)/golazyk
$(GO_BIN): $(GO_FILES)
cd go && make && cp golazyk ../$(BINDIR)/
.PHONY: go test-unit-go test-go
go: $(GO_BIN)
test-unit-go:
cd go && go test -v
test-go: $(GO_BIN)
sh run_tests.sh $(GO_BIN)
OCAML_FILES = $(wildcard ocaml/*.ml) ocaml/Makefile
OCAML_BIN = $(BINDIR)/mllazyk
$(OCAML_BIN): $(BINDIR) $(OCAML_FILES)
cd ocaml && make && cp mllazyk ../$(BINDIR)/
.PHONY: ocaml test-unit-ocaml test-ocaml
ocaml: $(OCAML_BIN)
test-unit-ocaml: $(OCAML_FILES)
cd ocaml && make test
test-ocaml: $(OCAML_BIN)
sh run_tests.sh $(OCAML_BIN)
PY_FILES = $(wildcard python/*.py)
.PHONY: test-unit-python test-python
test-unit-python: $(PY_FILES)
cd python && python3 -m lazyk_test
test-python: $(PY_FILES)
sh run_tests.sh python3 python/lazyk.py
RUBY_FILES = $(wildcard ruby/*.rb)
.PHONY: test-unit-ruby test-ruby
test-unit-ruby: $(RUBY_FILES)
ruby ruby/lazyk_test.rb
test-ruby:
sh run_tests.sh ruby ruby/lazyk.rb
SCHEME_FILES = $(wildcard scheme/*.scm)
.PHONY: test-unit-scheme test-scheme
test-unit-scheme:
gosh scheme/lazyk-test.scm
test-scheme:
sh run_tests.sh gosh scheme/lazyk.scm
TS_FILES = $(wildcard typescript/*.ts)
.PHONY: test-unit-typescript test-unit
test-unit-typescript: $(TS_FILES)
cd typescript && deno test
test-typescript: $(TS_FILES)
sh run_tests.sh deno run --allow-read typescript/lazyk.ts
.PHONY: test-all
test-all: test-commonlisp test-csharp test-go test-ocaml test-python test-ruby test-scheme test-typescript
ALLBIN = $(CL_FASL) $(CS_BIN) $(GO_BIN) $(OCAML_BIN)
.PHONY: clean
clean:
rm $(ALLBIN)
.PHONY: allbin
allbin: $(ALLBIN)
.PHONY: bench
bench:
sh ./bench_all.sh -n 5 >bench.log 2>&1