-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
67 lines (52 loc) · 1.79 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
RUN = go run -race .
LDFLAGS = -ldflags="-s -w"
INCLUDES = std.test:test/std.test,str.test:test/str.test,math.test:test/math.test,sort.test:test/sort.test,random.test:test/random.test,fmt.test:test/fmt.test,json.test:test/json.test,datetime.test:test/datetime.test,path.test:test/path.test,http.test:test/http.test,debug.test:test/debug.test,cli.test:test/cli.test,md.test:test/md.test,crypto.test:test/crypto.test,syntax.test:test/syntax.test
all: ci
# run the interpreter
run:
${RUN}
# run the autoformatter (from system Oak)
fmt:
oak fmt --changes --fix
f: fmt
# run Go tests
tests:
go test -race .
t: tests
# run Oak tests
test-oak:
${RUN} test/main.oak
tk: test-oak
# run oak build tests
test-bundle:
${RUN} build --entry test/main.oak --output /tmp/oak-test.oak --include ${INCLUDES}
${RUN} /tmp/oak-test.oak
# run oak pack tests
test-pack:
${RUN} pack --entry test/main.oak --output /tmp/oak-pack --include ${INCLUDES}
/tmp/oak-pack
# run oak build --web tests
test-js:
${RUN} build --entry test/main.oak --output /tmp/oak-test.js --web --include ${INCLUDES}
node /tmp/oak-test.js
# build for a specific GOOS target
build-%:
GOOS=$* go build ${LDFLAGS} -o oak-$* .
# build for all OS targets
build: build-linux build-darwin build-windows build-openbsd
# build Oak sources for the website
site:
oak build --entry www/src/app.js.oak --output www/static/js/bundle.js --web
oak build --entry www/src/highlight.js.oak --output www/static/js/highlight.js --web
# build Oak source for the website on file change, using entr
site-w:
ls www/src/app.js.oak | entr -cr make site
# generate static site pages
site-gen:
oak www/src/gen.oak
# install as "oak" binary
install:
cp tools/oak.vim ~/.vim/syntax/oak.vim
go build ${LDFLAGS} -o ${GOPATH}/bin/oak
# ci in travis
ci: tests test-oak test-bundle test-pack