1 # Make file for the pgn-extract program.
2 # Program: pgn-extract: a Portable Game Notation (PGN) extractor.
3 # Copyright (C) 1994-2014 David Barnes
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 1, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 # David Barnes may be contacted as D.J.Barnes@kent.ac.uk
19 # http://www.cs.kent.ac.uk/people/staff/djb/
21 OBJS=grammar.o lex.o map.o decode.o moves.o lists.o apply.o output.o eco.o\
22 lines.o end.o main.o hashing.o argsfile.o mymalloc.o fenmatcher.o\
23 taglines.o farmhash-c.o
26 # These flags are particularly severe on checking warnings.
27 # It may be that they are not all appropriate to your environment.
28 # For instance, not all environments have prototypes available for
29 # the standard library functions.
31 # Linux users might need to add -D__linux__ to these in order to
32 # use strcasecmp instead of strcmpi (cf output.c)
34 # Mac OS X users might need to add -D__unix__ to CFLAGS
35 # and use CC=cc or CC=gcc
37 CFLAGS+=-c -Wall -Wshadow -Wformat -Wpointer-arith \
38 -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings \
39 -Wsign-compare $(DEBUGINFO)\
40 -I/usr/local/lib/ansi-include \
45 # AIX 3.2 Users might like to use these alternatives for CFLAGS and CC.
46 # Thanks to Erol Basturk for providing them.
47 AIX_CFLAGS=-c -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_ALL_SOURCE
51 $(CC) $(DEBUGINFO) $(OBJS) $(LDLIBS) -o pgn-extract
54 purify $(CC) $(DEBUGINFO) $(OBJS) -o pgn-extract
57 rm -f core pgn-extract *.o
59 mymalloc.o : mymalloc.c mymalloc.h
60 $(CC) $(CFLAGS) mymalloc.c
62 apply.o : apply.c defs.h lex.h grammar.h typedef.h map.h bool.h apply.h taglist.h\
63 eco.h decode.h moves.h hashing.h mymalloc.h output.h fenmatcher.h
64 $(CC) $(CFLAGS) apply.c
66 argsfile.o : argsfile.c argsfile.h bool.h defs.h typedef.h lines.h \
67 taglist.h tokens.h lex.h taglines.h moves.h eco.h apply.h output.h \
69 $(CC) $(CFLAGS) argsfile.c
71 decode.o : decode.c defs.h typedef.h taglist.h lex.h bool.h decode.h lists.h \
73 $(CC) $(CFLAGS) decode.c
75 eco.o : eco.c defs.h lex.h typedef.h map.h bool.h eco.h taglist.h apply.h \
79 end.o : end.c end.h bool.h defs.h typedef.h lines.h tokens.h lex.h mymalloc.h \
83 grammar.o : grammar.c bool.h defs.h typedef.h lex.h taglist.h map.h lists.h\
84 moves.h apply.h output.h tokens.h eco.h end.h grammar.h hashing.h \
86 $(CC) $(CFLAGS) grammar.c
88 hashing.o : hashing.c hashing.h bool.h defs.h typedef.h tokens.h\
89 taglist.h lex.h mymalloc.h
90 $(CC) $(CFLAGS) hashing.c
92 lex.o : lex.c bool.h defs.h typedef.h tokens.h taglist.h map.h\
93 lists.h decode.h moves.h lines.h grammar.h mymalloc.h apply.h\
97 lines.o : lines.c bool.h lines.h mymalloc.h
98 $(CC) $(CFLAGS) lines.c
100 lists.o : lists.c lists.h taglist.h bool.h defs.h typedef.h mymalloc.h
101 $(CC) $(CFLAGS) lists.c
103 main.o : main.c bool.h defs.h typedef.h tokens.h taglist.h lex.h moves.h\
104 map.h lists.h output.h end.h grammar.h hashing.h \
105 argsfile.h mymalloc.h
106 $(CC) $(CFLAGS) main.c
108 map.o : map.c defs.h lex.h typedef.h map.h bool.h decode.h taglist.h \
110 $(CC) $(CFLAGS) map.c
112 moves.o : moves.c defs.h typedef.h lex.h bool.h map.h lists.h moves.h apply.h\
113 lines.h taglist.h mymalloc.h fenmatcher.h
114 $(CC) $(CFLAGS) moves.c
116 fenmatcher.o : fenmatcher.c apply.h bool.h defs.h fenmatcher.h mymalloc.h typedef.h
117 $(CC) $(CFLAGS) fenmatcher.c
119 output.o : output.c output.h taglist.h bool.h typedef.h defs.h lex.h grammar.h\
121 $(CC) $(CFLAGS) output.c
123 taglines.o : taglines.c bool.h defs.h typedef.h tokens.h taglist.h lex.h lines.h \
124 lists.h moves.h output.h taglines.h
125 $(CC) $(CFLAGS) taglines.c