Makefile: update rules
[mate.git] / Makefile
1 SHELL := bash
2
3 JAVAC := javac
4 JAVA_FILES := $(wildcard tests/*.java)
5 CLASS_FILES := $(JAVA_FILES:.java=.class)
6 HS_FILES := $(wildcard Mate/*.hs)
7
8 GHC_OPT := -Wall -O2 -fno-warn-unused-do-bind
9
10 all: mate $(CLASS_FILES)
11
12 test: mate $(CLASS_FILES)
13         ./$<
14
15 %.class: %.java
16         $(JAVAC) $<
17
18 trap.o mate: Mate.hs trap.c $(HS_FILES)
19         ghc --make $(GHC_OPT) Mate.hs trap.c -o mate
20
21 clean:
22         rm -f {Mate/,}*.hi {Mate/,}*.o mate tests/*.class
23
24 tags: Mate.hs $(HS_FILES) trap.o
25         @# @-fforce-recomp, see
26         @# http://stackoverflow.com/questions/7137414/how-do-i-force-interpretation-in-hint
27         ghc -fforce-recomp -e :ctags $^