]> git.sesse.net Git - pgn-extract/blob - Makefile
Push through a computer/human flag to the binary output.
[pgn-extract] / Makefile
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)
7 #    any later version.
8 #
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.
13 #
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.
17 #
18 #    David Barnes may be contacted as D.J.Barnes@kent.ac.uk
19 #    http://www.cs.kent.ac.uk/people/staff/djb/
20
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
24 DEBUGINFO=-g
25
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.
30
31 # Linux users might need to add -D__linux__ to these in order to
32 # use strcasecmp instead of strcmpi (cf output.c)
33
34 # Mac OS X users might need to add -D__unix__ to CFLAGS
35 # and use CC=cc or CC=gcc
36
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 \
41         -O3
42 CC=gcc
43 LDLIBS=-lfarmhash
44
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
48 AIX_CC=xlc
49
50 pgn-extract : $(OBJS)
51         $(CC) $(DEBUGINFO) $(OBJS) $(LDLIBS) -o pgn-extract
52
53 purify : $(OBJS)
54         purify $(CC) $(DEBUGINFO) $(OBJS) -o pgn-extract
55
56 clean:
57         rm -f core pgn-extract *.o
58
59 mymalloc.o : mymalloc.c mymalloc.h
60         $(CC) $(CFLAGS) mymalloc.c
61
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
65
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 \
68                 lists.h mymalloc.h
69         $(CC) $(CFLAGS) argsfile.c
70
71 decode.o : decode.c defs.h typedef.h taglist.h lex.h bool.h decode.h lists.h \
72             tokens.h mymalloc.h
73         $(CC) $(CFLAGS) decode.c
74
75 eco.o :  eco.c defs.h lex.h typedef.h map.h bool.h eco.h taglist.h apply.h \
76            mymalloc.h
77         $(CC) $(CFLAGS) eco.c
78
79 end.o : end.c end.h bool.h defs.h typedef.h lines.h tokens.h lex.h mymalloc.h \
80         apply.h grammar.h
81         $(CC) $(CFLAGS) end.c
82
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 \
85             mymalloc.h
86         $(CC) $(CFLAGS) grammar.c
87
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
91
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\
94         output.h
95         $(CC) $(CFLAGS) lex.c
96
97 lines.o : lines.c bool.h lines.h mymalloc.h
98         $(CC) $(CFLAGS) lines.c
99
100 lists.o :  lists.c lists.h taglist.h bool.h defs.h typedef.h mymalloc.h
101         $(CC) $(CFLAGS) lists.c
102
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
107
108 map.o :  map.c defs.h lex.h typedef.h map.h bool.h decode.h taglist.h \
109          mymalloc.h
110         $(CC) $(CFLAGS) map.c
111
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
115
116 fenmatcher.o : fenmatcher.c apply.h bool.h defs.h fenmatcher.h mymalloc.h typedef.h
117         $(CC) $(CFLAGS) fenmatcher.c
118
119 output.o :  output.c output.h taglist.h bool.h typedef.h defs.h lex.h grammar.h\
120             apply.h mymalloc.h
121         $(CC) $(CFLAGS) output.c
122
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
126