art: Clean up sys2/sysl/Makefile
-EXE=$(GOPATH)/bin/antlr
+EXE = $(GOPATH)/bin/sysl
JS = sysl_js/SyslParser.js
+ANTLR = java -jar lib/antlr-4.7-complete.jar
+
+GRAMMARS = SyslParser.g4 SyslLexer.g4
.PHONY : all
all: $(EXE) $(JS)
@@ -7,13 +10,11 @@ all: $(EXE) $(JS)
$(EXE): grammar/sysl_parser.go grammar/sysl_lexer.go sysl.go sysl_listener_impl.go
go install -v -buildmode=exe .
-grammar/sysl_parser.go: grammar/SyslParser.g4 grammar/SyslLexer.g4
- @echo $(EXE)
- java -jar lib/antlr-4.7-complete.jar -Dlanguage=Go -lib grammar grammar/SyslParser.g4 grammar/SyslLexer.g4
+grammar/sysl_parser.go grammar/sysl_lexer.go: grammar/SyslParser.g4 grammar/SyslLexer.g4
+ $(ANTLR) -Dlanguage=Go -lib grammar $^
-sysl_js/SyslParser.js: sysl_js/SyslParser.g4 sysl_js/SyslLexer.g4
- @echo $(JS)
- java -jar lib/antlr-4.7-complete.jar -Dlanguage=JavaScript -lib sysl_js sysl_js/SyslLexer.g4 sysl_js/SyslParser.g4
+$(JS): sysl_js/SyslParser.g4 sysl_js/SyslLexer.g4
+ $(ANTLR) -Dlanguage=JavaScript -lib sysl_js $^
# make run file=path/to/file.sysl args=-gui
.PHONY : run
