Makefile: optional call file for testcases
[mate.git] / Makefile
index 55954ae8cfe96aae03f252afb352f5063ac37cc2..48a1b4085ef31f34394ffa0c4e6a99ec7eeb5063 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -25,12 +25,18 @@ all: mate $(CLASS_FILES)
 
 tests: mate $(TEST_CLASS_FILES)
 
+CALLF = $(basename $@).call
+testcase = ./tools/openjdktest.sh "$(1) $(basename $@)"
 %.test: %.class mate
-       @./tools/openjdktest.sh $(basename $@)
-
+       @if [ -f $(CALLF) ]; \
+               then $(call testcase,`cat $(CALLF)`); \
+               else $(call testcase, ); fi
 
+COMPILEF = $(basename $@).compile
 %.class: %.java
-       $(JAVAC) $<
+       @if [ -f $(COMPILEF) ]; \
+               then $(SHELL) $(COMPILEF); \
+               else $(JAVAC) $<; fi
 
 ffi/native.o: ffi/native.c
        ghc -Wall -O2 -c $< -o $@