-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile.in
368 lines (266 loc) · 11.6 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
# Makefile for Tokyo Tyrant
#================================================================
# Setting Variables
#================================================================
# Generic settings
SHELL = @SHELL@
# Package information
PACKAGE = @PACKAGE_NAME@
VERSION = @PACKAGE_VERSION@
PACKAGEDIR = $(PACKAGE)-$(VERSION)
PACKAGETGZ = $(PACKAGE)-$(VERSION).tar.gz
LIBVER = @MYLIBVER@
LIBREV = @MYLIBREV@
PROTVER = @MYPROTVER@
# Targets
HEADERFILES = @MYHEADERFILES@
LIBRARYFILES = @MYLIBRARYFILES@
LIBOBJFILES = @MYLIBOBJFILES@
COMMANDFILES = @MYCOMMANDFILES@
INITFILES = @MYINITFILES@
MAN1FILES = @MYMAN1FILES@
MAN3FILES = @MYMAN3FILES@
MAN8FILES = @MYMAN8FILES@
SCREXTFILES = @MYSCREXTFILES@
DOCUMENTFILES = @MYDOCUMENTFILES@
PCFILES = @MYPCFILES@
# Install destinations
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
INCLUDEDIR = @includedir@
LIBDIR = @libdir@
BINDIR = @bindir@
SBINDIR = @sbindir@
LIBEXECDIR = @libexecdir@
DATADIR = @datadir@/$(PACKAGE)
MAN1DIR = @mandir@/man1
MAN3DIR = @mandir@/man3
MAN8DIR = @mandir@/man8
PCDIR = @libdir@/pkgconfig
DESTDIR =
# Building configuration
CC = @CC@
CPPFLAGS = @MYCPPFLAGS@ \
-D_TT_PREFIX="\"$(prefix)\"" -D_TT_INCLUDEDIR="\"$(INCLUDEDIR)\"" \
-D_TT_LIBDIR="\"$(LIBDIR)\"" -D_TT_BINDIR="\"$(BINDIR)\"" -D_TT_LIBEXECDIR="\"$(LIBEXECDIR)\"" \
-D_TT_APPINC="\"-I$(INCLUDEDIR)\"" -D_TT_APPLIBS="\"-L$(LIBDIR) -ltokyotyrant @LIBS@\""
CFLAGS = @MYCFLAGS@
LDFLAGS = @MYLDFLAGS@
CMDLDFLAGS = @MYCMDLDFLAGS@
LIBS = @LIBS@
LDENV = LD_RUN_PATH=/lib:/usr/lib:$(LIBDIR):$(HOME)/lib:/usr/local/lib:@MYRUNPATH@:.
RUNENV = @MYLDLIBPATHENV@=.:/lib:/usr/lib:$(LIBDIR):$(HOME)/lib:/usr/local/lib:@MYRUNPATH@
POSTCMD = @MYPOSTCMD@
#================================================================
# Suffix rules
#================================================================
.SUFFIXES :
.SUFFIXES : .c .o
.c.o :
$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
#================================================================
# Actions
#================================================================
all : $(LIBRARYFILES) $(COMMANDFILES)
@$(POSTCMD)
@printf '\n'
@printf '#================================================================\n'
@printf '# Ready to install.\n'
@printf '#================================================================\n'
clean :
rm -rf $(LIBRARYFILES) $(LIBOBJFILES) $(COMMANDFILES) \
*.o a.out check.in check.out gmon.out *.vlog words.tsv \
casket casket-* casket.* *.tch *.tcb *.tcf *.tct *.idx.* \
*.ulog ulog 1978* 1979* *.rts *.pid *~ hoge moge tako ika
version :
vernum=`expr $(LIBVER)00 + $(LIBREV)` ; \
sed -e 's/_TT_VERSION.*/_TT_VERSION "$(VERSION)"/' \
-e "s/_TT_LIBVER.*/_TT_LIBVER $$vernum/" \
-e 's/_TT_PROTVER.*/_TT_PROTVER "$(PROTVER)"/' ttutil.h > ttutil.h~
[ -f ttutil.h~ ] && mv -f ttutil.h~ ttutil.h
untabify :
ls *.c *.h | while read name ; \
do \
sed -e 's/\t/ /g' -e 's/ *$$//' $$name > $$name~; \
[ -f $$name~ ] && mv -f $$name~ $$name ; \
done
install :
mkdir -p $(DESTDIR)$(INCLUDEDIR)
cp -Rf $(HEADERFILES) $(DESTDIR)$(INCLUDEDIR)
mkdir -p $(DESTDIR)$(LIBDIR)
cp -Rf $(LIBRARYFILES) $(DESTDIR)$(LIBDIR)
mkdir -p $(DESTDIR)$(BINDIR)
cp -Rf $(COMMANDFILES) $(DESTDIR)$(BINDIR)
mkdir -p $(DESTDIR)$(SBINDIR)
cp -Rf $(INITFILES) $(DESTDIR)$(SBINDIR)
mkdir -p $(DESTDIR)$(DATADIR)
cp -Rf $(SCREXTFILES) $(DOCUMENTFILES) $(DESTDIR)$(DATADIR)
mkdir -p $(DESTDIR)$(MAN1DIR)
cd man && cp -Rf $(MAN1FILES) $(DESTDIR)$(MAN1DIR)
mkdir -p $(DESTDIR)$(MAN3DIR)
cd man && cp -Rf $(MAN3FILES) $(DESTDIR)$(MAN3DIR)
mkdir -p $(DESTDIR)$(MAN8DIR)
cd man && cp -Rf $(MAN8FILES) $(DESTDIR)$(MAN8DIR)
mkdir -p $(DESTDIR)$(PCDIR)
cp -Rf $(PCFILES) $(DESTDIR)$(PCDIR)
[ "$$UID" == 0 ] && ldconfig || true
@printf '\n'
@printf '#================================================================\n'
@printf '# Thanks for using Tokyo Tyrant.\n'
@printf '#================================================================\n'
install-strip :
make DESTDIR=$(DESTDIR) install
cd $(DESTDIR)$(BINDIR) && strip $(MYCOMMANDS)
uninstall :
cd $(DESTDIR)$(INCLUDEDIR) && rm -f $(HEADERFILES)
cd $(DESTDIR)$(LIBDIR) && rm -f $(LIBRARYFILES)
cd $(DESTDIR)$(BINDIR) && rm -f $(COMMANDFILES)
cd $(DESTDIR)$(SBINDIR) && rm -f $(INITFILES)
cd $(DESTDIR)$(MAN1DIR) && rm -f $(MAN1FILES)
cd $(DESTDIR)$(MAN3DIR) && rm -f $(MAN3FILES)
cd $(DESTDIR)$(MAN8DIR) && rm -f $(MAN8FILES)
rm -rf $(DESTDIR)$(DATADIR)
cd $(DESTDIR)$(PCDIR) && rm -f $(PCFILES)
[ "$$UID" == 0 ] && ldconfig || true
dist :
make version
make untabify
make distclean
cd .. && tar cvf - $(PACKAGEDIR) | gzip -c > $(PACKAGETGZ)
sync ; sync
distclean : clean
cd example && make clean
rm -rf Makefile tokyotyrant.pc config.cache config.log config.status autom4te.cache
check :
$(RUNENV) $(RUNCMD) ./tcrmgr version
$(RUNENV) $(RUNCMD) ./tcrtest write -cnum 5 -tout 5 -rnd 127.0.0.1 50000
$(RUNENV) $(RUNCMD) ./tcrtest write -cnum 5 -tout 5 -nr -rnd 127.0.0.1 50000
$(RUNENV) $(RUNCMD) ./tcrtest write -cnum 5 -tout 5 127.0.0.1 50000
$(RUNENV) $(RUNCMD) ./tcrtest read -cnum 5 -tout 5 127.0.0.1
$(RUNENV) $(RUNCMD) ./tcrtest read -cnum 5 -tout 5 -mul 5 127.0.0.1
$(RUNENV) $(RUNCMD) ./tcrtest remove -cnum 5 -tout 5 127.0.0.1
$(RUNENV) $(RUNCMD) ./tcrtest rcat -cnum 5 -tout 5 127.0.0.1 50000
$(RUNENV) $(RUNCMD) ./tcrtest rcat -cnum 5 -tout 5 -shl 50 127.0.0.1 50000
$(RUNENV) $(RUNCMD) ./tcrmgr vanish 127.0.0.1
$(RUNENV) $(RUNCMD) ./tcrtest rcat -cnum 5 -tout 5 -dad 127.0.0.1 50000
$(RUNENV) $(RUNCMD) ./tcrtest rcat -cnum 5 -tout 5 -ext putcat -xlr 127.0.0.1 50000
$(RUNENV) $(RUNCMD) ./tcrtest misc -cnum 5 -tout 5 127.0.0.1 5000
$(RUNENV) $(RUNCMD) ./tcrtest wicked -cnum 5 -tout 5 127.0.0.1 5000
$(RUNENV) $(RUNCMD) ./tcrmgr inform 127.0.0.1
$(RUNENV) $(RUNCMD) ./tcrmgr vanish 127.0.0.1
$(RUNENV) $(RUNCMD) ./tcrmttest write -tnum 5 127.0.0.1 5000
$(RUNENV) $(RUNCMD) ./tcrmttest read -tnum 5 127.0.0.1
$(RUNENV) $(RUNCMD) ./tcrmttest remove -tnum 5 127.0.0.1
$(RUNENV) $(RUNCMD) ./tcrmttest write -tnum 5 -ext putcat -rnd 127.0.0.1 5000
$(RUNENV) $(RUNCMD) ./tcrmttest typical -tnum 5 127.0.0.1 5000
$(RUNENV) $(RUNCMD) ./tcrmgr vanish 127.0.0.1
$(RUNENV) $(RUNCMD) ./tcrmgr put 127.0.0.1 one first
$(RUNENV) $(RUNCMD) ./tcrmgr put 127.0.0.1 two second
$(RUNENV) $(RUNCMD) ./tcrmgr put -dk 127.0.0.1 three third
$(RUNENV) $(RUNCMD) ./tcrmgr put -dc 127.0.0.1 three third
$(RUNENV) $(RUNCMD) ./tcrmgr put -dc 127.0.0.1 three third
$(RUNENV) $(RUNCMD) ./tcrmgr put -dc 127.0.0.1 three third
$(RUNENV) $(RUNCMD) ./tcrmgr put 127.0.0.1 four fourth
$(RUNENV) $(RUNCMD) ./tcrmgr put -dk 127.0.0.1 five fifth
$(RUNENV) $(RUNCMD) ./tcrmgr out 127.0.0.1 one
$(RUNENV) $(RUNCMD) ./tcrmgr out 127.0.0.1 two
$(RUNENV) $(RUNCMD) ./tcrmgr get 127.0.0.1 three > check.out
$(RUNENV) $(RUNCMD) ./tcrmgr get 127.0.0.1 four > check.out
$(RUNENV) $(RUNCMD) ./tcrmgr get 127.0.0.1 five > check.out
$(RUNENV) $(RUNCMD) ./tcrmgr mget 127.0.0.1 one two three four five > check.out
$(RUNENV) $(RUNCMD) ./tcrmgr misc 127.0.0.1 putlist six sixth seven seventh
$(RUNENV) $(RUNCMD) ./tcrmgr misc 127.0.0.1 outlist six
$(RUNENV) $(RUNCMD) ./tcrmgr misc 127.0.0.1 getlist three four five six > check.out
$(RUNENV) $(RUNCMD) ./tcrmgr list -pv 127.0.0.1 > check.out
$(RUNENV) $(RUNCMD) ./tcrmgr list -pv -fm f 127.0.0.1 > check.out
$(RUNENV) $(RUNCMD) ./tcrmgr http -ih http://127.0.0.1:1978/five > check.out
rm -rf ulog ; mkdir -p ulog
$(RUNENV) $(RUNCMD) ./ttultest write -lim 10000 ulog 5000
$(RUNENV) $(RUNCMD) ./ttultest write -lim 10000 -as ulog 5000
$(RUNENV) $(RUNCMD) ./ttultest read ulog
rm -rf ulog ; mkdir -p ulog
$(RUNENV) $(RUNCMD) ./ttultest thread -lim 10000 ulog 5 5000
$(RUNENV) $(RUNCMD) ./ttultest thread -lim 10000 -as ulog 5 5000
@printf '\n'
@printf '#================================================================\n'
@printf '# Checking completed.\n'
@printf '#================================================================\n'
check-valgrind :
make RUNCMD="valgrind --tool=memcheck --log-file=%p.vlog" check
grep ERROR *.vlog | grep -v ' 0 errors' ; true
grep 'at exit' *.vlog | grep -v ' 0 bytes' ; true
check-forever :
while true ; \
do \
make check || break ; \
done
words :
cat -n /usr/share/dict/words | \
sed -e 's/^ *//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' \
-e 's/^\([0-9]*\)\t\(.*\)/\2\t\1/' > words.tsv
./tcrmgr importtsv localhost words.tsv
.PHONY : all clean install check
#================================================================
# Building binaries
#================================================================
libtokyotyrant.a : $(LIBOBJFILES)
$(AR) $(ARFLAGS) $@ $(LIBOBJFILES)
libtokyotyrant.so.$(LIBVER).$(LIBREV).0 : $(LIBOBJFILES)
if uname -a | egrep -i 'SunOS' > /dev/null ; \
then \
$(CC) $(CFLAGS) -shared -Wl,-G,-h,libtokyotyrant.so.$(LIBVER) -o $@ \
$(LIBOBJFILES) $(LDFLAGS) $(LIBS) ; \
else \
$(CC) $(CFLAGS) -shared -Wl,-soname,libtokyotyrant.so.$(LIBVER) -o $@ \
$(LIBOBJFILES) $(LDFLAGS) $(LIBS) ; \
fi
libtokyotyrant.so.$(LIBVER) : libtokyotyrant.so.$(LIBVER).$(LIBREV).0
ln -f -s libtokyotyrant.so.$(LIBVER).$(LIBREV).0 $@
libtokyotyrant.so : libtokyotyrant.so.$(LIBVER).$(LIBREV).0
ln -f -s libtokyotyrant.so.$(LIBVER).$(LIBREV).0 $@
libtokyotyrant.$(LIBVER).$(LIBREV).0.dylib : $(LIBOBJFILES)
$(CC) $(CFLAGS) -dynamiclib -o $@ \
-install_name $(LIBDIR)/libtokyotyrant.$(LIBVER).dylib \
-current_version $(LIBVER).$(LIBREV).0 -compatibility_version $(LIBVER) \
$(LIBOBJFILES) $(LDFLAGS) $(LIBS)
libtokyotyrant.$(LIBVER).dylib : libtokyotyrant.$(LIBVER).$(LIBREV).0.dylib
ln -f -s libtokyotyrant.$(LIBVER).$(LIBREV).0.dylib $@
libtokyotyrant.dylib : libtokyotyrant.$(LIBVER).$(LIBREV).0.dylib
ln -f -s libtokyotyrant.$(LIBVER).$(LIBREV).0.dylib $@
ttskelmock.so : ttskelmock.o
$(CC) $(CFLAGS) -shared -o $@ $< $(LDFLAGS) $(LIBS)
ttskeldir.so : ttskeldir.o
$(CC) $(CFLAGS) -shared -o $@ $< $(LDFLAGS) $(LIBS)
ttskelproxy.so : ttskelproxy.o
$(CC) $(CFLAGS) -shared -o $@ $< $(LDFLAGS) $(LIBS)
ttskelnull.so : ttskelnull.o
$(CC) $(CFLAGS) -shared -o $@ $< $(LDFLAGS) $(LIBS)
ttskelmock.bundle : ttskelmock.o
$(CC) $(CFLAGS) -bundle -flat_namespace -undefined suppress -o $@ $< $(LDFLAGS) $(LIBS)
ttskeldir.bundle : ttskeldir.o
$(CC) $(CFLAGS) -bundle -flat_namespace -undefined suppress -o $@ $< $(LDFLAGS) $(LIBS)
ttskelproxy.bundle : ttskelproxy.o
$(CC) $(CFLAGS) -bundle -flat_namespace -undefined suppress -o $@ $< $(LDFLAGS) $(LIBS)
ttskelnull.bundle : ttskelnull.o
$(CC) $(CFLAGS) -bundle -flat_namespace -undefined suppress -o $@ $< $(LDFLAGS) $(LIBS)
ttserver : ttserver.o scrext.o $(LIBRARYFILES)
$(LDENV) $(CC) $(CFLAGS) -o $@ $< scrext.o $(LDFLAGS) $(CMDLDFLAGS) -ltokyotyrant $(LIBS)
ttulmgr : ttulmgr.o $(LIBRARYFILES)
$(LDENV) $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(CMDLDFLAGS) -ltokyotyrant $(LIBS)
ttultest : ttultest.o $(LIBRARYFILES)
$(LDENV) $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(CMDLDFLAGS) -ltokyotyrant $(LIBS)
tcrtest : tcrtest.o $(LIBRARYFILES)
$(LDENV) $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(CMDLDFLAGS) -ltokyotyrant $(LIBS)
tcrmttest : tcrmttest.o $(LIBRARYFILES)
$(LDENV) $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(CMDLDFLAGS) -ltokyotyrant $(LIBS)
tcrmgr : tcrmgr.o $(LIBRARYFILES)
$(LDENV) $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(CMDLDFLAGS) -ltokyotyrant $(LIBS)
myconf.o scrext.o : myconf.h
ttutil.o : myconf.h ttutil.h
tculog.o : myconf.h ttutil.h tculog.h
tcrdb.o : myconf.h ttutil.h tcrdb.h
ttskelproxy.o : myconf.h ttutil.h tcrdb.h
ttserver.o ttulmgr.o ttultest.o tcrtest.o tcrmgr.o : myconf.h ttutil.h tculog.h tcrdb.h
ttserver.o : scrext.h
# END OF FILE