summaryrefslogtreecommitdiff
path: root/test/Makefile
diff options
context:
space:
mode:
authorCamil Staps2017-11-26 11:14:26 +0100
committerCamil Staps2017-11-26 11:14:26 +0100
commitb77da9b3135e5f1a77e3759db7adca50f8df443d (patch)
treee3fb21ec3cf2a145aaa710931b87a5b85a6f9a17 /test/Makefile
parentFix merge problem (diff)
Add Markov chain test
Diffstat (limited to 'test/Makefile')
-rw-r--r--test/Makefile27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/Makefile b/test/Makefile
new file mode 100644
index 0000000..3b9b4a7
--- /dev/null
+++ b/test/Makefile
@@ -0,0 +1,27 @@
+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
+
+.PHONY=all data run clean
+
+all: $(EXE)
+
+dataset.pgn:
+ 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)
+ ./$(EXE) < dataset.pgn
+
+$(EXE): %: %.hs $(SRC)
+ $(GHC) $(GHCFLAGS) $< -o $@
+
+clean:
+ $(RM) $(EXE) $(AUX)