]> code.delx.au - gnu-emacs-elpa/blob - Makefile.am
For some reason, chess-pos.el needs to be compiled first.
[gnu-emacs-elpa] / Makefile.am
1 BUILT_SOURCES = chess-auto.el
2 CLEANFILES = TAGS chess-auto.el auto-autoloads.el
3 EXTRA_DIST = autogen.sh chess-auto.el.in chess-eco.pos doc/chess.pdf
4 DISTCLEANFILES = chess-eco.fen doc/chess.info doc/chess.pdf $(TESTS)
5 info_TEXINFOS = doc/chess.texi
6 dist_lisp_DATA = _pkg.el chess-eco.fen
7
8 dist_lisp_LISP = \
9 chess-pos.el \
10 chess.el \
11 chess-ai.el \
12 chess-algebraic.el \
13 chess-announce.el \
14 chess-auto.el \
15 chess-autosave.el \
16 chess-chat.el \
17 chess-clock.el \
18 chess-common.el \
19 chess-crafty.el \
20 chess-database.el \
21 chess-display.el \
22 chess-engine.el \
23 chess-epd.el \
24 chess-fen.el \
25 chess-file.el \
26 chess-game.el \
27 chess-german.el \
28 chess-gnuchess.el \
29 chess-ics.el \
30 chess-ics1.el \
31 chess-ics2.el \
32 chess-images.el \
33 chess-input.el \
34 chess-irc.el \
35 chess-kibitz.el \
36 chess-link.el \
37 chess-log.el \
38 chess-message.el \
39 chess-module.el \
40 chess-network.el \
41 chess-none.el \
42 chess-pgn.el \
43 chess-phalanx.el \
44 chess-plain.el \
45 chess-ply.el \
46 chess-puzzle.el \
47 chess-random.el \
48 chess-scid.el \
49 chess-sjeng.el \
50 chess-sound.el \
51 chess-stockfish.el \
52 chess-test.el \
53 chess-transport.el \
54 chess-tutorial.el \
55 chess-ucb.el \
56 chess-uci.el \
57 chess-var.el \
58 chess-eco.el
59
60 chess-auto.el: $(ELFILES)
61 echo ";;; DO NOT MODIFY THIS FILE" > $(top_builddir)/chess-auto.el
62 echo "(if (featurep 'chess-auto) (error \"Already loaded\"))" \
63 >> $(top_builddir)/chess-auto.el
64 $(EMACS) -batch -L $(srcdir) -l chess-maint.el \
65 -f chess-generate-autoloads \
66 $(top_builddir)/chess-auto.el $(srcdir)
67 echo "(provide 'chess-auto)" >> $(top_builddir)/chess-auto.el
68 ln -f $(top_builddir)/chess-auto.el $(top_builddir)/auto-autoloads.el
69
70 chess-eco.fen: chess-eco.pos chess-eco.el
71 $(EMACS) --no-init-file --no-site-file -batch \
72 -L $(srcdir) -l chess-eco -f chess-generate-fen-table \
73 chess-eco.pos chess-eco.fen
74
75 TESTS = chess-test
76 DATABASE = $(shell test -r test/largedb.sg3 && echo test/largedb || echo test/historic.pgn)
77 START = $(shell test -r test/largedb.sg3 && perl -e 'print int(rand(4000000)), "\n";' || echo 0)
78 COUNT = 100000
79
80 # Note: There are 4,209,433 games in test/largedb, if you download the files
81 # from:
82 #
83 # ftp://ftp.newartisans.com/pub/chess/largedb.7z
84 #
85 # If you have a dual-core CPU (or more), you'll get the best performance by
86 # running a separate Emacs for each core. Here's how I run all the tests on
87 # my dual-core MacBook Pro: (Note, removing chess-test is just a precaution,
88 # since the Makefile will not regenerate it if you aborted a previous test
89 # run).
90 #
91 # chess1 $ rm -f chess-test; nice -n 20 make START=0 COUNT=2104715 check
92 # chess2 $ rm -f chess-test; nice -n 20 make START=2104715 COUNT=0 check
93 #
94 # I run both of these using `screen', with a vertical split so I can watch
95 # them both running. I type C-a H in each screen window before starting, so
96 # that all the output is logged to a file I can examine afterward.
97 #
98 # Note that these tests can take days to run. My MacBook Pro gets around
99 # 2,000 plies per second. If you're a Lisp hacker and want to improve the
100 # speed of that, the slowness is pretty much all in `chess-search-position',
101 # in the file chess-pos.el.
102
103 chess-test:
104 echo "$(EMACS) -batch -L $(srcdir) -l chess-test.el -f chess-test '$(DATABASE)' $(START) $(COUNT); rm -f $(top_builddir)/chess-test" > $@
105 chmod u+x $@
106
107 test/twic.pgn:
108 (set -e; f=$$(pwd)/$@; tmp_dir=`mktemp -d`; \
109 cd $$tmp_dir; \
110 lftp -c "open http://www.theweekinchess.com/zips/; mget twic*g.zip"; \
111 for zip in *.zip; do unzip $$zip; done; \
112 cat *.pgn > $$f; rm *.pgn)
113
114 check-twic: test/twic.pgn
115 $(MAKE) DATABASE=$< START=0 COUNT=0 check
116
117 TAGS: $(dist_lisp_LISP)
118 @etags $(dist_lisp_LISP)
119 @echo TAGS rebuilt.
120
121 # Makefile.am ends here