summaryrefslogtreecommitdiff
path: root/test/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'test/Makefile')
-rw-r--r--test/Makefile31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/Makefile b/test/Makefile
new file mode 100644
index 0000000..ba62dab
--- /dev/null
+++ b/test/Makefile
@@ -0,0 +1,31 @@
+EXE:=Test
+DEP:=ArbitraryMove
+AUX:=$(addsuffix .o, $(EXE) $(DEP))\
+ $(addsuffix .hi, $(EXE) $(DEP))\
+ $(addsuffix .dyn_o, $(EXE) $(DEP))\
+ $(addsuffix .dyn_hi,$(EXE) $(DEP))
+SRC:=$(addsuffix .hs,$(DEP))
+GHC:=ghc
+GHCFLAGS:=-O -main-is Test.main
+DATA:=dataset.pgn
+
+.PHONY=all run clean
+
+all: $(EXE)
+
+$(DATA):
+ for i in $$(seq 1000 1020); do wget -q http://www.theweekinchess.com/zips/twic$${i}g.zip; unzip -q twic$${i}g.zip; rm twic$${i}g.zip; done
+ cat twic*.pgn > $@
+ $(RM) twic*.pgn
+
+run: $(EXE) $(DATA)
+ ./$(EXE) < $(DATA)
+
+$(EXE): %: %.hs $(SRC)
+ $(GHC) $(GHCFLAGS) $< -o $@
+
+clean:
+ $(RM) $(EXE) $(AUX)
+
+distclean: clean
+ $(RM) $(DATA)