Makefile: build all class files in tests/
[mate.git] / Makefile
index 8965f9a14eb43c198cb081565f19ef0abb2f4f21..289fe3fe39708daee2d41d31055865d1c4b86928 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,15 @@
-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 $<
 
-mate: Mate.hs
-       ghc --make -O2 $< -o $@
+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