25 lines
507 B
Makefile
25 lines
507 B
Makefile
|
all: grammars
|
||
|
|
||
|
.PHONY: grammars
|
||
|
grammars: *.g4 grammars/__init__.py
|
||
|
java -cp "${PWD}/antlr4.jar" org.antlr.v4.Tool -Dlanguage=Python3 $< -no-listener -visitor -o grammars
|
||
|
grammars/__init__.py: antlr4.jar requirements
|
||
|
mkdir -p grammars
|
||
|
touch $@
|
||
|
|
||
|
.PHONY: requirements
|
||
|
requirements:
|
||
|
python3 -m pip install -r requirements.txt
|
||
|
|
||
|
antlr4.jar:
|
||
|
rm -f *.jar
|
||
|
wget https://www.antlr.org/download/antlr-4.10.1-complete.jar
|
||
|
mv *.jar antlr4.jar
|
||
|
|
||
|
.PHONY: clean
|
||
|
clean:
|
||
|
rm -rf grammars
|
||
|
|
||
|
.PHONY: test
|
||
|
test: ${TESTS}
|