forked from pzbitskiy/tealang
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
30 lines (21 loc) · 820 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
default: build
all: go test grammar-java
build: go
ANTLR4_JAR := /usr/local/lib/antlr-4.8-complete.jar
grammar-all: grammar-go
grammar-go:
java -jar $(ANTLR4_JAR) -Dlanguage=Go -o gen/go TealangLexer.l4
java -jar $(ANTLR4_JAR) -Dlanguage=Go -o gen/go TealangParser.g4
grammar-java:
java -jar $(ANTLR4_JAR) TealangLexer.l4 -o gen/java
java -jar $(ANTLR4_JAR) TealangParser.g4 -o gen/java
javac gen/java/Tealang*.java -classpath "gen/java:$(ANTLR4_JAR)"
go: grammar-go
go generate ./...
go build -o tealang ./main.go
test:
go test ./...
java-trace: grammar-java
java -classpath "gen/java:$(ANTLR4_JAR)" org.antlr.v4.gui.TestRig Tealang program -diagnostics -trace $(ARGS)
java-gui: grammar-java
java -classpath "gen/java:$(ANTLR4_JAR)" org.antlr.v4.gui.TestRig Tealang program -diagnostics -gui $(ARGS)