summaryrefslogblamecommitdiff
path: root/test/Makefile
blob: ba62dabd72523f4c9569c10343a5421588cf7ef6 (plain) (tree)
1
2
3
4
5
6
7
8
9







                                           
                 
 
                    

           
        


                                                                                                                                                  
                          




                                   

                     
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)