Makefile: update rules
authorBernhard Urban <lewurm@gmail.com>
Sun, 8 Apr 2012 22:35:44 +0000 (00:35 +0200)
committerBernhard Urban <lewurm@gmail.com>
Sun, 8 Apr 2012 22:35:44 +0000 (00:35 +0200)
Makefile

index 3fcf204a6b523071d1ca73ee37eb1eb80d1880a8..350162140fe924a6b8c0951fe69d81adde416fa8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,22 +1,27 @@
-JAVAC = javac
+SHELL := bash
+
+JAVAC := javac
 JAVA_FILES := $(wildcard tests/*.java)
 CLASS_FILES := $(JAVA_FILES:.java=.class)
+HS_FILES := $(wildcard Mate/*.hs)
+
+GHC_OPT := -Wall -O2 -fno-warn-unused-do-bind
 
 all: mate $(CLASS_FILES)
 
-test: mate
-       ./mate tests/Test.class
+test: mate $(CLASS_FILES)
+       ./$<
 
 %.class: %.java
-       javac $<
+       $(JAVAC) $<
 
-trap.o mate: Mate.hs trap.c
-       ghc --make -Wall -O2 $^ -o mate
+trap.o mate: Mate.hs trap.c $(HS_FILES)
+       ghc --make $(GHC_OPT) Mate.hs trap.c -o mate
 
 clean:
-       rm -f *.hi *.o mate src/*.class
+       rm -f {Mate/,}*.hi {Mate/,}*.o mate tests/*.class
 
-tags: Mate.hs Mate/Utilities.hs trap.o
+tags: Mate.hs $(HS_FILES) trap.o
        @# @-fforce-recomp, see
        @# http://stackoverflow.com/questions/7137414/how-do-i-force-interpretation-in-hint
        ghc -fforce-recomp -e :ctags $^