aft-may25-2023/Makefile

25 lines
507 B
Makefile
Raw Permalink Normal View History

2023-05-24 19:05:16 -06:00
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}