Use gcore for creating core dump on segfault
[capablanca.git] / lasker-2.2.3 / src / Makefile.in
1 ##
2 ##  fics - An internet chess server.
3 ##  Copyright (C) 1993  Richard V. Nash
4 ##  Copyright (C) 2000  Dan Papasian.  All rights reserved.
5 ##
6 ##  This program is free software; you can redistribute it and/or modify
7 ##  it under any terms you see fit as long as this message, the
8 ##  copyright message, and the disclaimer below remain intact.
9 ## 
10 ##
11 ##  This program is distributed in the hope that it will be useful,
12 ##  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 ##
15 ##
16 ##  This is the Makefile template; see machine dependant config.h for
17 ##  more configuration options.
18
19
20 SHELL = /bin/sh
21 srcdir = @srcdir@
22 VPATH = @srcdir@
23
24 CHESSD_CFLAGS = @CHESSD_CFLAGS@
25 CC=@CC@
26
27 ##
28 ##  Where to install FICS
29 ##
30 PREFIX = @prefix@
31 exec_prefix = @exec_prefix@
32 bindir = ${exec_prefix}/bin
33
34 PICFLAG = -fPIC
35 DYNEXP=-rdynamic
36
37 ##
38 ##  Binaries and Options to use
39 ##
40 CFLAGS += $(PICFLAG) -m32 -Wall @CFLAGS@ -DTDB_STANDALONE ${CHESSD_CFLAGS} -I${srcdir} -I${srcdir}/tdb
41
42 INSTALL = @INSTALL@
43 INSTALL_DATA = @INSTALL_DATA@
44 LIBS = @LIBS@ -lm 
45 LNFLAGS = @LDFLAGS@ -m32 ${LIBS}
46 CHESSDDIR = ${PREFIX}/chessd
47
48 TDB_SRC = tdb/tdb.c tdb/spinlock.c
49
50 GEN_SRCS=adminproc.c algcheck.c board.c command.c talkproc.c comproc.c \
51         formula.c gamedb.c gamedb_old.c gameproc.c config.c \
52         lists.c malloc.c reload.c follow.c help.c news.c \
53         movecheck.c multicol.c network.c playerdb.c playerdb_old.c ratings.c \
54         utils.c variable.c vers.c eco.c matchproc.c \
55         obsproc.c pending.c gics.c setup.c shutdown.c seekproc.c \
56         parsers/parser.c parsers/genparser.c iset.c \
57         crypt.c crypt-md5.c crypt-md5c.c crypt-misc.c timeseal.c $(TDB_SRC)
58
59 SRCS=$(GEN_SRCS) fics_addplayer.c ficsmain.c makerank.c
60
61 OBJS=$(GEN_SRCS:.c=.o)
62
63 VERSION=./newvers.sh
64
65 ALL= chessd chessd.so chessd_addplayer makerank
66
67 all: ${ALL}
68
69 .autoheaders: proto.h parsers/parse_info.h
70         touch .autoheaders
71
72 chessd: .autoheaders ficsmain.o
73         $(CC) $(DYNEXP) $(CFLAGS) $(LNFLAGS) -o chessd ficsmain.o $(LIBS)
74
75 chessd.so: .autoheaders $(OBJS)
76         $(CC) -m32 -shared -o chessd.so $(OBJS)
77
78 chessd_addplayer: .autoheaders fics_addplayer.o $(OBJS) 
79         $(CC) -m32 fics_addplayer.o $(CFLAGS) $(OBJS) $(LNFLAGS) -o chessd_addplayer $(LIBS)
80
81 makerank: .autoheaders makerank.o 
82         $(CC) -m32 makerank.o $(OBJS) -o makerank $(LIBS)
83
84 vers.c:
85         ${VERSION}
86
87 depend:
88         makedepend -- ${CFLAGS} ${MAKEDEPMORECFLAGS} -- ${SRCS}
89
90 proto.h: $(GEN_SRCS)
91         awk -f mkproto.awk $(GEN_SRCS) > proto.h
92
93 parsers/parse_info.h: $(shell /bin/ls *.h | sed s/proto.h//g)
94         parsers/genstruct.pl -o parsers/parse_info.h $(CC) -E $(CFLAGS) includes.h
95
96 clean: 
97         rm -f *.o $(OBJS) ${ALL} *~ vers.c proto.h parsers/parse_info.h .autoheaders
98
99 distclean: clean
100         rm -rf Makefile autoconfig.h config.status config.cache config.log
101
102 # useful dependency
103 command.o: command_list.h
104
105 parsers/parser.o: parsers/parse_info.h
106
107 # this is needed to handle compilers that insist on putting code in the current
108 # directory with -c
109 .c.o:
110         $(CC) -c $(CFLAGS) -o $*.o $*.c
111
112 install: $(ALL)
113         install -d -m0755 ${CHESSDDIR}
114         install -d -m0755 ${CHESSDDIR}/bin
115         install -d -m0755 ${CHESSDDIR}/lib
116         install -m0755 chessd ${CHESSDDIR}/bin
117         install -m0755 chessd.so ${CHESSDDIR}/lib
118         install -m0755 makerank ${CHESSDDIR}/bin
119         install -m0755 chessd_addplayer ${CHESSDDIR}/bin
120         install -d -m0755 ${CHESSDDIR}/players
121         install -d -m0755 ${CHESSDDIR}/spool
122         install -d -m0755 ${CHESSDDIR}/data/admin
123         install -d -m0755 ${CHESSDDIR}/data/book
124         install -d -m0755 ${CHESSDDIR}/data/help
125         install -d -m0755 ${CHESSDDIR}/data/usage
126         install -d -m0755 ${CHESSDDIR}/data/messages
127         install -d -m0755 ${CHESSDDIR}/data/stats
128         install -d -m0755 ${CHESSDDIR}/data/boards/wild
129         install -d -m0755 ${CHESSDDIR}/data/boards/capablanca
130         install -d -m0755 ${CHESSDDIR}/data/boards/knightmate
131         install -d -m0755 ${CHESSDDIR}/data/boards/gothic
132         install -d -m0755 ${CHESSDDIR}/data/boards/super
133         install -d -m0755 ${CHESSDDIR}/data/boards/crazyhouse
134         install -d -m0755 ${CHESSDDIR}/data/boards/fischerandom
135         install -d -m0755 ${CHESSDDIR}/data/boards/fr
136         install -d -m0755 ${CHESSDDIR}/data/boards/zh
137         install -d -m0755 ${CHESSDDIR}/data/boards/shatranj
138         install -d -m0755 ${CHESSDDIR}/data/boards/xiangqi
139         install -d -m0755 ${CHESSDDIR}/data/boards/shogi
140         install -d -m0755 ${CHESSDDIR}/data/boards/caparandom
141         install -d -m0755 ${CHESSDDIR}/data/boards/courier
142         install -d -m0755 ${CHESSDDIR}/data/boards/fairy
143         install -d -m0755 ${CHESSDDIR}/data/boards/great
144         install -d -m0755 ${CHESSDDIR}/data/boards/seirawan
145         install -d -m0755 ${CHESSDDIR}/data/boards/spartan
146         install -d -m0755 ${CHESSDDIR}/games/history
147         install -d -m0755 ${CHESSDDIR}/games/journal
148         install -d -m0755 ${CHESSDDIR}/games/adjourned
149         install -d -m0755 ${CHESSDDIR}/data/stats/player_data
150         install -d -m0755 ${CHESSDDIR}/data/lists
151         cp -u ${srcdir}/../data/lists/td ${CHESSDDIR}/data/lists
152         cp -u ${srcdir}/../data/admin/[a-z]* ${CHESSDDIR}/data/admin
153         cp -u ${srcdir}/../data/book/[a-z]* ${CHESSDDIR}/data/book
154         cp -u ${srcdir}/../data/help/[a-z]* ${CHESSDDIR}/data/help
155         cp -u ${srcdir}/../data/usage/[a-z]* ${CHESSDDIR}/data/usage
156         cp -u ${srcdir}/../data/messages/[a-z]* ${CHESSDDIR}/data/messages
157         cp -u ${srcdir}/../data/boards/capablanca/* ${CHESSDDIR}/data/boards/capablanca
158         cp -u ${srcdir}/../data/boards/gothic/* ${CHESSDDIR}/data/boards/gothic
159         cp -u ${srcdir}/../data/boards/knightmate/* ${CHESSDDIR}/data/boards/knightmate
160         cp -u ${srcdir}/../data/boards/fischerandom/* ${CHESSDDIR}/data/boards/fischerandom
161         cp -u ${srcdir}/../data/boards/shatranj/* ${CHESSDDIR}/data/boards/shatranj
162         cp -u ${srcdir}/../data/boards/crazyhouse/* ${CHESSDDIR}/data/boards/crazyhouse
163         cp -u ${srcdir}/../data/boards/super/* ${CHESSDDIR}/data/boards/super
164         cp -u ${srcdir}/../data/boards/wild/* ${CHESSDDIR}/data/boards/wild
165         cp -u ${srcdir}/../data/boards/xiangqi/* ${CHESSDDIR}/data/boards/xiangqi
166         cp -u ${srcdir}/../data/boards/shogi/* ${CHESSDDIR}/data/boards/shogi
167         cp -u ${srcdir}/../data/boards/courier/* ${CHESSDDIR}/data/boards/courier
168         cp -u ${srcdir}/../data/boards/fairy/* ${CHESSDDIR}/data/boards/fairy
169         cp -u ${srcdir}/../data/boards/great/* ${CHESSDDIR}/data/boards/great
170         cp -u ${srcdir}/../data/boards/caparandom/* ${CHESSDDIR}/data/boards/caparandom
171         cp -u ${srcdir}/../data/boards/seirawan/* ${CHESSDDIR}/data/boards/seirawan
172         cp -u ${srcdir}/../data/boards/seirawan/* ${CHESSDDIR}/data/boards/spartan
173         perl -e 'mkdir("${CHESSDDIR}/players/$$_",0755) for ("a".."z")'
174         perl -e 'mkdir("${CHESSDDIR}/games/history/$$_",0755) for ("0".."99")'
175         perl -e 'mkdir("${CHESSDDIR}/games/journal/$$_",0755) for ("a".."z")'
176         perl -e 'mkdir("${CHESSDDIR}/data/stats/player_data/$$_",0755) for ("a".."z")'
177         perl -e 'mkdir("${CHESSDDIR}/games/adjourned/$$_",0755) for ("a".."z")'
178
179 etags:
180         etags *.[ch] */*.[ch]
181
182 findglobal:
183         nm $(OBJS) | grep ' C '
184         nm $(OBJS) | grep ' D '