Makefile: build all class files in tests/
[mate.git] / Makefile
index 08f7d2b28655bc654ef8948435a259a1afd89398..289fe3fe39708daee2d41d31055865d1c4b86928 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,9 @@
-all: mate Test.class
-       ./mate Test.class
+JAVAC = javac
+JAVA_FILES := $(wildcard tests/*.java)
+CLASS_FILES := $(JAVA_FILES:.java=.class)
+
+all: mate $(CLASS_FILES)
+       ./mate tests/Test.class
 
 %.class: %.java
        javac $<
@@ -8,4 +12,4 @@ mate: Mate.hs ./src/Utilities.hs trap.c
        ghc --make -Wall -O2 $^ -o $@
 
 clean:
-       rm -f *.hi *.o mate
+       rm -f *.hi *.o mate src/*.class