-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
73 lines (54 loc) · 1.21 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
.PHONY: test clean deps lint all fuzz
.PHONY: verbose doc l1-tests release
.PHONY: tco-test slow fast run-examples
PROG=l1
all: deps fast slow l1c-test
slow: tco-test
fast: test ${PROG} l1-tests run-examples lint doc
deps:
go get .
${PROG}: *.go lisp/*.go lisp/l1.l1
go build -o l1 .
test:
go test -v ./lisp
l1-tests: ${PROG}
./l1 tests.l1
./l1 -e "(println (+ 1 1))"
./l1 -e "(load 'examples/fact.l1)"
./l1 -e "(error '(goodbye, cruel world))" && exit 1 || echo "Got expected error"
run-examples: ${PROG}
./l1 examples/fact.l1
./l1 examples/fails.l1 && exit 1 || true
./l1 examples/primes.l1
./l1 examples/sentences.l1
./l1 examples/galax.l1
./l1 examples/meta.l1
tco-test: ${PROG}
./l1 examples/tco.l1
l1c-test: ${PROG}
echo "(println 1 2 3)" > /tmp/l123.l1
./l1c /tmp/l123.l1 -o /tmp/l123
/tmp/l123
lint:
golint -set_exit_status .
staticcheck .
clean:
rm -f ${PROG}
install: ${PROG}
go install .
cp l1c ${GOPATH}/bin
verbose: all # The tests are fast! Just do it again, verbosely:
go test -v ./lisp
docker:
docker build -t ${PROG} .
doc:
./l1 -longdoc > api.md
cat intro.md api.md > l1.md
python updatereadme.py
release:
./bumpver
make clean
make
fuzz:
make
./l1 examples/fuzz.l1