NichtHaskell2.0/Makefile

38 lines
1.5 KiB
Makefile
Raw Permalink Normal View History

2024-07-04 19:13:38 +00:00
### IntelliJs play buttons do not work. Run in "src/test" folder with "make" command to run all
### Or run only parts with "make compile-javac", "make clean" etc.
all: compile-javac compile-miniCompiler
compile-javac:
#javac -d src/test/resources/output/javac src/test/resources/input/CompilerInput.java
compile-miniCompiler:
cd ../.. ; mvn -DskipTests install
cd ../.. ; mvn exec:java -DgenJar=true -DgenClass=true -Dexec.mainClass="main.Main" -Dexec.args="'src/main/resources/input/CompilerInput.java' 'src/main/resources/output'"
# cp src/main/resources/output/CompilerInput.class src/test/resources/output/miniCompiler
test-miniCompiler:
# move the compiled class to the test/main folder
mv src/main/resources/output/CompilerInput.class src/test/java/main/
# compile the test class
javac src/test/java/main/EndToEndTester.java
# run the test class
java -cp src/test/java/main EndToEndTester
clean:
# clean main output folders
rm -f src/main/resources/output/*.class
rm -f src/main/resources/output/*.jar
# clean resources output folders
rm -f src/test/resources/output/javac/*.class
rm -f src/test/resources/output/miniCompiler/*.class
rm -f src/test/resources/output/miniCompiler/*.jar
# clean logs
rm -f src/main/resources/logs/*
# clean test/java/main folders from .class files for End-to-End tests
rm -f src/test/java/main/*.class
# clean javac output from every folder
rm -f src/test/resources/input/*/*.class
# clean test results from maven surefire plugin
rm -f ../../target/surefire-reports/*.txt