forked from cheusov/dictd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
436 lines (354 loc) · 13 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
# Makefile.in -- Makefile for dict
# Created: Wed Apr 24 14:14:09 1996 by [email protected]
# Copyright 1996-2002 Rickard E. Faith ([email protected])
# Copyright 2002-2008 Aleksey Cheusov ([email protected])
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 1, or (at your option) any
# later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Add a _letter_ if you change the version number and release your own version.
# Numbers are for the original author(s) only.
DICT_VERSION=@DICT_VERSION@
ifneq (,)
This makefile requires GNU Make.
endif
.SUFFIXES:
srcdir= @srcdir@
VPATH= @srcdir@:.
prefix= @prefix@
subdirs= @allsubdirs@ # doc -- use rfc2229 instead
exec_prefix= @exec_prefix@
man1_prefix= @mandir@/man1
man8_prefix= @mandir@/man8
bindir= @bindir@
libdir= @libdir@
libexecdir= @libexecdir@
sbindir= @sbindir@
includedir= @includedir@
datadir= @datadir@
DESTDIR=
SHELL= /bin/sh
USE_PLUGIN=@USE_PLUGIN@
EXEEXT=@EXEEXT@
CONF_DIR=@sysconfdir@
PLUGIN_DIR=${libexecdir}
DICT_DIR=${datadir}
CC= @CC@
CXX= @CXX@
CPP= @CPP@
LIBTOOL= @LIBTOOL@
INSTALL= @INSTALL@ -c
INSTALL_PROGRAM=@INSTALL_PROGRAM@ -c
INSTALL_SCRIPT= @INSTALL_SCRIPT@ -c
INSTALL_DATA= @INSTALL_DATA@ -c
LEX= @LEX@
YACC= @YACC@
LEXLIB= @LEXLIB@
CFLAGS= @CPPFLAGS@ @DEFS@ @CFLAGS@ -DDICT_PLUGIN_PATH=\"$(PLUGIN_DIR)/\" -DDICT_DICTIONARY_PATH=\"$(DICT_DIR)/\" -DDICT_VERSION=\"$(DICT_VERSION)\" -DDICT_CONFIG_PATH=\"$(CONF_DIR)/\" -I. -I$(srcdir)
LIBMAA= @LIBMAA@
LIBS= @LIBS@ ${LIBMAA}
LDFLAGS= @LDFLAGS@
LIBOBJS= @LIBOBJS@
EXES= dict dictd dictzip dictfmt
all: $(EXES) $(LIBRARIES)
ifdef USE_PLUGIN
PLUGINS=@PLUGINS@
#dictdplugin_man.la
LIBRARIES=
#libdictdplugin.a
INCLUDES= dictdplugin.h
all: plugins
.PHONY : samples install.samples uninstall.samples
samples : dictdplugin_exit.la dictdplugin_popen.la
install.samples : samples
mkdir -p $(DESTDIR)$(libexecdir) && \
$(LIBTOOL) --mode=install $(INSTALL) -c dictdplugin_exit.la dictdplugin_popen.la $(DESTDIR)$(libexecdir) && \
$(INSTALL_SCRIPT) search_man $(DESTDIR)$(libexecdir)
uninstall.samples :
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libexecdir)/search_man.la
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libexecdir)/dictdplugin_exit.la
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libexecdir)/dictdplugin_popen.la
endif
ifdef USE_PLUGIN
SRCHOBJS= index.o data.o str.o plugin.o #dictdplugin.o
else
SRCHOBJS= index.o data.o str.o #dictdplugin.o
endif
NETOBJS= daemon.o strategy.o net.o servscan.o servparse.o md5.o
CLIOBJS= net.o clientscan.o clientparse.o md5.o
TMPS= servscan.c servparse.c servparse.h \
clientscan.c clientparse.c clientparse.h
@SET_MAKE@
%.o: %.c
$(LIBTOOL) --tag=CC --mode=compile $(CC) -c $(CFLAGS) $< -o $@
%.o: %.cpp
$(LIBTOOL) --tag=CXX --mode=compile $(CXX) -c $(CFLAGS) $< -o $@
%: %.o
$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ -static \
$^ $(OBJS) $(LDFLAGS) -lz ${LIBS}
include $(srcdir)/deps
dictd.o : servparse.h
$(PLUGINS) dictdplugin_popen.la dictdplugin_exit.la : $(LIBOBJS)
# libdictdplugin.a
lib%.a : %.o
$(AR) rc $@ $^
%.la : %.o $(LIBOBJS)
$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ -module \
$(^:.o=.lo) \
-rpath "${PLUGIN_DIR}" \
$(LDFLAGS) ${LIBS}
dictdplugin_man.la : data.o str.o heap.o dictdplugin_man.o \
plugins_common.o $(LIBOBJS)
$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ -module \
$(^:.o=.lo) \
-rpath "${PLUGIN_DIR}" \
$(LDFLAGS) ${LIBS}
dictdplugin_judy.la : data.o str.o heap.o dictdplugin_judy.o \
plugins_common.o $(LIBOBJS)
$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ -module \
$(^:.o=.lo) \
-rpath "${PLUGIN_DIR}" \
$(LDFLAGS) -lJudy ${LIBS}
dictdplugin_dbi.la : heap.o dictdplugin_dbi.o str.o \
plugins_common.o $(LIBOBJS)
$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ -module \
$(^:.o=.lo) \
-rpath "${PLUGIN_DIR}" \
$(LDFLAGS) -ldbi ${LIBS}
.PHONY: plugins
plugins: $(PLUGINS)
dict : $(CLIOBJS) $(LIBOBJS) parse.o
dictd : $(NETOBJS) $(SRCHOBJS) $(LIBOBJS) parse.o
dictzip : data.o $(LIBOBJS)
dictfmt : str.o $(LIBOBJS)
servscan.c: servscan.l
$(LEX) $(LFLAGS) $< && mv lex.yy.c $@
servscan.o: servscan.c servparse.o servparse.h
servparse.c servparse.h : servparse.y
$(YACC) -tdv $<; \
cmp -s y.tab.h servparse.h || mv y.tab.h servparse.h; \
cmp -s y.tab.c servparse.c || mv y.tab.c servparse.c; \
rm -f y.tab.h y.tab.c
servparse.o: servparse.c
clientscan.c: clientscan.l
$(LEX) $(LFLAGS) -o$@ $<
clientscan.o: clientscan.c clientparse.o clientparse.h
clientparse.c clientparse.h: clientparse.y
$(YACC) -tdv $<; \
cmp -s y.tab.h clientparse.h || mv y.tab.h clientparse.h; \
cmp -s y.tab.c clientparse.c || mv y.tab.c clientparse.c; \
rm -f y.tab.h y.tab.c
clientparse.o: clientparse.c
.PHONY: install.dict install.dictzip install.dictfmt install.dictd \
install.libs install.includes install.colorit
install.dict: dict
mkdir -p $(DESTDIR)$(bindir) && \
mkdir -p $(DESTDIR)$(man1_prefix) && \
$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) dict$(EXEEXT) $(DESTDIR)$(bindir)/ && \
$(INSTALL_DATA) dict.1 $(DESTDIR)$(man1_prefix)/ && \
$(INSTALL_SCRIPT) dictl $(DESTDIR)$(bindir)/ && \
$(INSTALL_DATA) dictl.1 $(DESTDIR)$(man1_prefix)/
$(INSTALL_SCRIPT) @srcdir@/dict_lookup $(DESTDIR)$(bindir)/ && \
$(INSTALL_DATA) dict_lookup.1 $(DESTDIR)$(man1_prefix)/
install.colorit: colorit
mkdir -p $(DESTDIR)$(bindir) && \
mkdir -p $(DESTDIR)$(man1_prefix) && \
$(INSTALL_SCRIPT) colorit $(DESTDIR)$(bindir) && \
$(INSTALL_DATA) colorit.1 $(DESTDIR)$(man1_prefix)
install.dictzip: dictzip
mkdir -p $(DESTDIR)$(bindir) && \
mkdir -p $(DESTDIR)$(man1_prefix) && \
$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) dictzip$(EXEEXT) $(DESTDIR)$(bindir) && \
$(INSTALL_DATA) dictzip.1 $(DESTDIR)$(man1_prefix)/dictzip.1
install.dictfmt: dictfmt dictfmt_index2word dictfmt_index2suffix
mkdir -p $(DESTDIR)$(bindir) && \
mkdir -p $(DESTDIR)$(man1_prefix) && \
$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) dictfmt$(EXEEXT) $(DESTDIR)$(bindir) && \
$(INSTALL_SCRIPT) dictfmt_index2suffix $(DESTDIR)$(bindir) && \
$(INSTALL_SCRIPT) dictfmt_index2word $(DESTDIR)$(bindir) && \
$(INSTALL_SCRIPT) dictunformat $(DESTDIR)$(bindir) && \
$(INSTALL_DATA) dictfmt.1 $(DESTDIR)$(man1_prefix) && \
$(INSTALL_DATA) dictfmt_index2word.1 $(DESTDIR)$(man1_prefix) && \
$(INSTALL_DATA) dictfmt_index2suffix.1 $(DESTDIR)$(man1_prefix) && \
$(INSTALL_DATA) dictunformat.1 $(DESTDIR)$(man1_prefix)
install.dictd: dictd
mkdir -p $(DESTDIR)$(sbindir) && \
mkdir -p $(DESTDIR)$(man8_prefix) && \
$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) dictd$(EXEEXT) $(DESTDIR)$(sbindir) && \
$(INSTALL_DATA) dictd.8 $(DESTDIR)$(man8_prefix)/dictd.8
install.libs: $(LIBRARIES)
if test _$(USE_PLUGIN) != _; then \
mkdir -p $(DESTDIR)$(libdir) && \
if test "$(LIBRARIES)"; then \
$(INSTALL_DATA) $(LIBRARIES) $(DESTDIR)$(libdir); fi fi
install.includes:
if test _$(USE_PLUGIN) != _; then \
mkdir -p $(DESTDIR)$(includedir) && \
if test "$(INCLUDES)"; then \
$(INSTALL_DATA) $(addprefix @srcdir@/, $(INCLUDES)) \
$(DESTDIR)$(includedir); \
fi fi
install.plugins:
if test _$(USE_PLUGIN) != _; then \
mkdir -p $(DESTDIR)$(libexecdir) && \
if test "$(PLUGINS)"; then \
$(LIBTOOL) --mode=install $(INSTALL_DATA) $(PLUGINS) $(DESTDIR)$(PLUGIN_DIR); else true; fi fi
.PHONY: install
install: \
install.dict install.dictzip install.dictd install.dictfmt \
install.libs install.includes install.plugins install.colorit
ifdef USE_PLUGIN
$(INSTALL_SCRIPT) dictdplugin-config $(DESTDIR)$(bindir)
endif
uninstall.dict:
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/dict$(EXEEXT)
rm -f $(DESTDIR)$(man1_prefix)/dict.1
rm -f $(DESTDIR)$(bindir)/dictl $(DESTDIR)$(man1_prefix)/dictl.1
uninstall.dictzip:
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/dictzip$(EXEEXT)
rm -f $(DESTDIR)$(man1_prefix)/dictzip.1
uninstall.dictd:
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(sbindir)/dictd$(EXEEXT)
rm -f $(DESTDIR)$(man8_prefix)/dictd.8
uninstall.dictfmt:
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/dictfmt$(EXEEXT)
rm -f $(DESTDIR)$(man1_prefix)/dictfmt.1
rm -f $(DESTDIR)$(man1_prefix)/dictfmt_index2word.1
rm -f $(DESTDIR)$(man1_prefix)/dictfmt_index2suffix.1
rm -f $(DESTDIR)$(man1_prefix)/dictunformat.1
rm -f $(DESTDIR)$(bindir)/dictfmt_index2suffix
rm -f $(DESTDIR)$(bindir)/dictfmt_index2word
rm -f $(DESTDIR)$(bindir)/dictunformat
uninstall.colorit:
rm -f $(DESTDIR)$(bindir)/colorit $(DESTDIR)$(man1_prefix)/colorit.1
uninstall.includes:
ifdef USE_PLUGIN
rm -f $(addprefix $(DESTDIR)$(includedir)/, $(INCLUDES))
endif
uninstall.libs:
ifdef USE_PLUGIN
if test "$(LIBRARIES)"; then \
rm -f $(addprefix $(DESTDIR)$(libdir)/, $(LIBRARIES)); \
else true; fi
endif
uninstall.plugins:
ifdef USE_PLUGIN
if test "$(PLUGINS)"; then \
$(LIBTOOL) --mode=uninstall \
rm -f $(addprefix $(DESTDIR)$(libexecdir)/, $(PLUGINS)); \
fi
endif
.PHONY: uninstall
.PHONY: \
uninstall.dict uninstall.dictzip uninstall.dictfmt uninstall.dictd \
uninstall.libs uninstall.includes uninstall.plugins uninstall.colorit
uninstall: \
uninstall.dict uninstall.dictzip uninstall.dictfmt uninstall.dictd \
uninstall.libs uninstall.includes uninstall.plugins uninstall.colorit
ifdef USE_PLUGIN
rm -f $(DESTDIR)$(bindir)/dictdplugin-config
endif
.PHONY: ChangeLog
ChangeLog:
@(echo "***** Making new ChangeLog..."; \
rm -f ChangeLog; \
AWK=@AWK@ rcs2log -i 2 -r -d'1996-09-20<' . doc | \
./exclude_libmaa_logs | \
sed -e 's,/cvsroot/dict/dictd1/,,g' \
-e 's,/cvs/dict/dictd1/,,g' \
-e 's,cheusov *<cheusov@[^>]*>,Aleksey Cheusov <[email protected]>,g' \
-e 's,faith *<faith@[^>]*>,Rik Faith <[email protected]>,g' \
-e 's,hilliard...hilliard@.*,Bob Hilliard <[email protected]>,g' \
-e 's,tek...tek@.*,Julian Squires <[email protected]>,g' \
-e 's,\(.*\)<\([^@<>]\+\)@\([^@<>]\+\)>\(.*\),\1<\2 at \3}\4,g' \
> ChangeLog;)
cvsdist:
@( CVSROOT=`cat CVS/Root` && \
export CVSROOT && \
VERSION=$(DICT_VERSION) && \
VERSION_CVS=`echo $${VERSION} | tr . -` && \
export VERSION VERSION_CVS && \
$(MAKE) ChangeLog && \
cp ChangeLog /tmp/dictd.ChangeLog.$${VERSION} && \
echo "***** Exporting files for dictd-$${VERSION}..." && \
cd /tmp && \
rm -rf /tmp/dictd-$${VERSION} && \
cvs export -fd dictd-$${VERSION} -r dictd-$${VERSION_CVS} dictd1 && \
cd dictd-$${VERSION} && \
rm -rf libmaa && \
mv /tmp/dictd.ChangeLog.$${VERSION} ChangeLog && \
autoheader && autoconf && \
rm -rf autom4te.cache libmaa/autom4te.cache && \
chmod -R a+rX,g-w . && \
cd .. && \
echo "***** Taring and zipping dictd-$${VERSION}.tar.gz..." && \
tar cvvf dictd-$${VERSION}.tar dictd-$${VERSION} && \
gzip -9f dictd-$${VERSION}.tar && \
echo "***** Done making /tmp/dictd-$${VERSION}.tar.gz")
.PHONY: clean distclean tags
clean:
-rm -f *.o *.lo *.os *.a *.la *.s *~ core a.out config.log
-rm -f $(EXES) $(TMPS)
-rm -f *.log *.aux *.toc *.dvi *.ps
-rm -f *.cfg *.dtk .inslog tca.map
-rm -f *.dct *.idx y.output TAGS
-rm -f *.dict *.index
-rm -f *.exe *.dll
-rm -f test/_* test/testdb.t.txt test/log.txt
-rm -f ChangeLog*
recursive-clean: clean
@for subdir in `echo $(subdirs)`; do \
echo making clean in $$subdir; \
(cd $$subdir && $(MAKE) clean) || exit 1; \
done
distclean: recursive-clean
@for subdir in `echo $(subdirs)`; do \
echo making $@ in $$subdir; \
(cd $$subdir && $(MAKE) $@) || exit 1; \
done
rm -f config.h config.cache config.status stamp-h.in stamp-h
rm -f Makefile doc/Makefile dictdplugin-config
rm -f colorit dictl dictunformat
rm -f test/dictd_test test/dictzip_test
rm -rf autom4te.cache libmaa/autom4te.cache
rm -f dictfmt_index2suffix dictfmt_index2word
rm -f *.1 *.8
cvsclean: distclean
rm -f configure libmaa/configure config.h.in libmaa/config.h.in
tags:
etags *.[ch]
deps:
for i in *.c *.cpp; do \
gcc -MM $$i 2>/dev/null; \
done | awk '{gsub(/ \/[^ ]+/, ""); print}' | \
sed 's,\(.*[.]\)o,\1o \1os,1' > deps
.PHONY: test
test: $(EXES) $(LIBRARIES)
cd test && sh dictd_test && sh dictzip_test
# The following is based on the "Automatic Remaking" node in the GNU
# Autoconf documentation:
$(srcdir)/configure: configure.in
cd $(srcdir) && autoconf
# autoheader might not change config.h.in, so touch a stamp file.
${srcdir}/config.h.in: stamp-h.in
${srcdir}/stamp-h.in: configure.in
cd ${srcdir} && autoheader
touch ${srcdir}/stamp-h.in
config.h: stamp-h
stamp-h: config.h.in config.status
./config.status
Makefile: Makefile.in config.status
./config.status
config.status: configure
./config.status --recheck