src: move files into a Mate package
[mate.git] / Makefile
index 7bc23cfc42fe8bf023ba07e6cb825eab0ecbd8b9..3fcf204a6b523071d1ca73ee37eb1eb80d1880a8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,22 @@
-all: mate Test.class
-       ./mate Test.class
+JAVAC = javac
+JAVA_FILES := $(wildcard tests/*.java)
+CLASS_FILES := $(JAVA_FILES:.java=.class)
+
+all: mate $(CLASS_FILES)
+
+test: mate
+       ./mate tests/Test.class
 
 %.class: %.java
        javac $<
 
-mate: Mate.hs trap.c
-       ghc --make -Wall -O2 $^ -o $@
+trap.o mate: Mate.hs trap.c
+       ghc --make -Wall -O2 $^ -o mate
 
 clean:
-       rm -f *.hi *.o mate
+       rm -f *.hi *.o mate src/*.class
+
+tags: Mate.hs Mate/Utilities.hs trap.o
+       @# @-fforce-recomp, see
+       @# http://stackoverflow.com/questions/7137414/how-do-i-force-interpretation-in-hint
+       ghc -fforce-recomp -e :ctags $^