1# Makefile to build QDBM using libtool
2
3
4
5#================================================================
6# Setting variables
7#================================================================
8
9
10# Generic settings
11SHELL = @SHELL@
12
13# Packaging
14PACKAGE = @PACKAGE_NAME@
15VERSION = @PACKAGE_VERSION@
16LIBVER = @LIBVER@
17LIBREV = @LIBREV@
18
19# Targets
20MYHEADS = depot.h curia.h relic.h hovel.h cabin.h villa.h vista.h odeum.h
21MYLIBOBJS = depot.lo curia.lo relic.lo hovel.lo cabin.lo villa.lo vista.lo odeum.lo myconf.lo
22MYLIBS = libqdbm.la
23MYBINS = dpmgr dptest dptsv crmgr crtest crtsv rlmgr rltest hvmgr hvtest \
24  cbtest cbcodec vlmgr vltest vltsv odmgr odtest odidx qmttest
25MYMAN1S = dpmgr.1 dptest.1 dptsv.1 crmgr.1 crtest.1 crtsv.1 rlmgr.1 rltest.1 hvmgr.1 hvtest.1 \
26  cbtest.1 cbcodec.1 vlmgr.1 vltest.1 vltsv.1 odmgr.1 odtest.1 odidx.1 qmttest.1
27MYMAN3S = qdbm.3 depot.3 dpopen.3 curia.3 cropen.3 relic.3 hovel.3 \
28  cabin.3 villa.3 vlopen.3 vista.3 odeum.3 odopen.3
29MYDOCS = spex.html spex-ja.html COPYING ChangeLog NEWS THANKS
30MYPCS = qdbm.pc
31
32# Install destinations
33prefix = @prefix@
34exec_prefix = @exec_prefix@
35MYHEADDIR = @includedir@
36MYLIBDIR = @libdir@
37MYBINDIR = @bindir@
38MYMAN1DIR = @mandir@/man1
39MYMAN3DIR = @mandir@/man3
40MYSHAREDIR = $(prefix)/share/$(PACKAGE)
41MYPCDIR = @libdir@/pkgconfig
42
43# Building binaries
44LIBTOOL = libtool
45CC = gcc
46CFLAGS = -I. -I$(MYHEADDIR) -I$(HOME)/include -I/usr/local/include @MYDEFS@ \
47  -D_XOPEN_SOURCE_EXTENDED=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__=1 -D_HPUX_SOURCE=1 \
48  -D_POSIX_MAPPED_FILES=1 -D_POSIX_SYNCHRONIZED_IO=1 \
49  -DPIC=1 -D_THREAD_SAFE=1 -D_REENTRANT=1 -DNDEBUG -O3
50LD = gcc
51LIBLDFLAGS = -rpath $(MYLIBDIR) -R $(MYLIBDIR) \
52  -version-info $$(($(LIBVER)+$(LIBREV))):0:$(LIBREV) @LIBS@
53LDFLAGS = -rpath $(MYLIBDIR) -R $(MYLIBDIR) -L. -lqdbm @LIBS@
54INSTALL = install
55MKDIR = mkdir -p
56CP = cp -rf
57RM = rm -rf
58
59
60
61#================================================================
62# Suffix rules
63#================================================================
64
65
66.SUFFIXES :
67.SUFFIXES : .c .lo
68
69.c.lo :
70	$(LIBTOOL) --mode=compile --tag=CC $(CC) -c $(CFLAGS) $<
71
72
73
74#================================================================
75# Actions
76#================================================================
77
78
79all : $(MYLIBS) $(MYBINS)
80	@printf '\n'
81	@printf '#================================================================\n'
82	@printf '# Ready to install.\n'
83	@printf '#================================================================\n'
84
85
86clean :
87	$(RM) $(MYLIBS) $(MYBINS) *.o *.a *.so *.lo *.la a.out .libs \
88	  *.exe *.dll.a *.dll TAGS srcdoc gmon.out leak.log casket casket.* *~
89
90
91install :
92	$(LIBTOOL) --mode=install $(INSTALL) $(MYHEADS) $(MYHEADDIR)
93	$(LIBTOOL) --mode=install $(INSTALL) $(MYLIBS) $(MYLIBDIR)
94	$(LIBTOOL) --mode=install $(INSTALL) $(MYBINS) $(MYBINDIR)
95	$(MKDIR) $(MYMAN1DIR)
96	cd man && $(CP) $(MYMAN1S) $(MYMAN1DIR)
97	$(MKDIR) $(MYMAN3DIR)
98	cd man && $(CP) $(MYMAN3S) $(MYMAN3DIR)
99	$(MKDIR) $(MYSHAREDIR)
100	$(CP) $(MYDOCS) $(MYSHAREDIR)
101	$(MKDIR) $(MYPCDIR)
102	$(CP) $(MYPCS) $(MYPCDIR)
103	@printf '\n'
104	@printf '#================================================================\n'
105	@printf '# Thanks for using QDBM.\n'
106	@printf '#================================================================\n'
107
108
109uninstall :
110	cd $(MYHEADDIR) && $(LIBTOOL) --mode=uninstall $(RM) $(MYHEADS)
111	cd $(MYLIBDIR) && $(LIBTOOL) --mode=uninstall $(RM) $(MYLIBS)
112	cd $(MYBINDIR) && $(LIBTOOL) --mode=uninstall $(RM) $(MYBINS)
113	cd $(MYMAN1DIR) && $(RM) $(MYMAN1S)
114	cd $(MYMAN3DIR) && $(RM) $(MYMAN3S)
115	$(RM) $(MYSHAREDIR)
116	cd $(MYPCDIR) && $(RM) $(MYPCS)
117
118
119distclean : clean
120	$(RM) Makefile LTmakefile rpmspec config.cache config.log config.status autom4te.cache
121
122
123check :
124	$(RM) casket*
125	$(LIBTOOL) --mode=execute ./dptest write -s casket 500 500000
126	$(LIBTOOL) --mode=execute ./dptest write casket 50000 5000
127	$(LIBTOOL) --mode=execute ./dptest read casket
128	$(LIBTOOL) --mode=execute ./dptest read -wb casket
129	$(LIBTOOL) --mode=execute ./dptest rcat -c casket 50000 50 500 32 8
130	$(LIBTOOL) --mode=execute ./dptest combo casket
131	$(LIBTOOL) --mode=execute ./dptest wicked -c casket 5000
132	$(LIBTOOL) --mode=execute ./dptest wicked casket 500
133	$(LIBTOOL) --mode=execute ./dpmgr repair casket
134	$(LIBTOOL) --mode=execute ./dpmgr optimize casket
135	$(LIBTOOL) --mode=execute ./dpmgr list casket
136	$(RM) casket*
137	$(LIBTOOL) --mode=execute ./crtest write -s casket 500 100000 5
138	$(LIBTOOL) --mode=execute ./crtest write casket 50000 500 10
139	$(LIBTOOL) --mode=execute ./crtest read casket
140	$(LIBTOOL) --mode=execute ./crtest read -wb casket
141	$(LIBTOOL) --mode=execute ./crtest rcat -c casket 50000 5 10 500 32 8
142	$(LIBTOOL) --mode=execute ./crtest combo casket
143	$(LIBTOOL) --mode=execute ./crtest wicked -c casket 5000
144	$(LIBTOOL) --mode=execute ./crtest wicked casket 500
145	$(LIBTOOL) --mode=execute ./crmgr repair casket
146	$(LIBTOOL) --mode=execute ./crmgr optimize casket
147	$(LIBTOOL) --mode=execute ./crmgr list casket
148	$(RM) casket*
149	$(LIBTOOL) --mode=execute ./crtest write -lob casket 1000 50 10
150	$(LIBTOOL) --mode=execute ./crtest read -lob casket
151	$(RM) casket*
152	$(LIBTOOL) --mode=execute ./rltest write casket 5000
153	$(LIBTOOL) --mode=execute ./rltest read casket 5000
154	$(LIBTOOL) --mode=execute ./rlmgr list casket
155	$(RM) casket*
156	$(LIBTOOL) --mode=execute ./hvtest write casket 5000
157	$(LIBTOOL) --mode=execute ./hvtest read casket 5000
158	$(LIBTOOL) --mode=execute ./hvmgr optimize casket
159	$(LIBTOOL) --mode=execute ./hvmgr list casket
160	$(RM) casket*
161	$(LIBTOOL) --mode=execute ./hvtest write -qdbm -s casket 500
162	$(LIBTOOL) --mode=execute ./hvtest write -qdbm casket 5000
163	$(LIBTOOL) --mode=execute ./hvtest read -qdbm casket 5000
164	$(RM) casket*
165	$(LIBTOOL) --mode=execute ./cbtest sort 5000
166	$(LIBTOOL) --mode=execute ./cbtest strstr 500
167	$(LIBTOOL) --mode=execute ./cbtest list 50000
168	$(LIBTOOL) --mode=execute ./cbtest list -d 500
169	$(LIBTOOL) --mode=execute ./cbtest map 50000 500
170	$(LIBTOOL) --mode=execute ./cbtest map -d 500 5
171	$(LIBTOOL) --mode=execute ./cbtest heap 50000 500
172	$(LIBTOOL) --mode=execute ./cbtest heap -d 500 50
173	$(LIBTOOL) --mode=execute ./cbtest wicked 5000
174	$(LIBTOOL) --mode=execute ./cbtest misc
175	$(RM) casket*
176	$(LIBTOOL) --mode=execute ./vltest write -tune 32 31 32 32 casket 50000
177	$(LIBTOOL) --mode=execute ./vltest read casket
178	$(LIBTOOL) --mode=execute ./vltest rdup -tune 32 31 512 256 casket 50000 50000
179	$(LIBTOOL) --mode=execute ./vltest combo casket
180	$(LIBTOOL) --mode=execute ./vltest wicked -c casket 5000
181	$(LIBTOOL) --mode=execute ./vltest wicked casket 500
182	$(LIBTOOL) --mode=execute ./vlmgr repair casket
183	$(LIBTOOL) --mode=execute ./vlmgr optimize casket
184	$(LIBTOOL) --mode=execute ./vlmgr list casket
185	$(RM) casket*
186	$(LIBTOOL) --mode=execute ./vltest write -int -cz -tune 32 31 32 32 casket 50000
187	$(LIBTOOL) --mode=execute ./vltest read -int -vc casket
188	$(LIBTOOL) --mode=execute ./vltest rdup -int -cz -cc -tune 32 31 512 256 casket 50000 50000
189	$(LIBTOOL) --mode=execute ./vltest combo -cz casket
190	$(LIBTOOL) --mode=execute ./vltest wicked -cz -c casket 5000
191	$(LIBTOOL) --mode=execute ./vltest combo -cy casket
192	$(LIBTOOL) --mode=execute ./vltest wicked -cy -c casket 5000
193	$(LIBTOOL) --mode=execute ./vltest combo -cx casket
194	$(LIBTOOL) --mode=execute ./vltest wicked -cx -c casket 5000
195	$(RM) casket*
196	$(LIBTOOL) --mode=execute ./odtest write casket 500 50 5000
197	$(LIBTOOL) --mode=execute ./odtest read casket
198	$(LIBTOOL) --mode=execute ./odtest combo casket
199	$(LIBTOOL) --mode=execute ./odtest wicked casket 500
200	$(RM) casket*
201	$(LIBTOOL) --mode=execute ./qmttest casket 50000 10
202	$(RM) casket*
203	@printf '\n'
204	@printf '#================================================================\n'
205	@printf '# Checking completed.\n'
206	@printf '#================================================================\n'
207
208
209.PHONY : all clean install check
210
211
212
213#================================================================
214# Building binaries
215#================================================================
216
217
218libqdbm.la : $(MYLIBOBJS)
219	$(LIBTOOL) --mode=link --tag=CC $(LD) $(MYLIBOBJS) -o $@ $(LIBLDFLAGS)
220
221
222dpmgr : dpmgr.lo $(MYLIBS)
223	$(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ dpmgr.lo $(LDFLAGS)
224
225
226dptest : dptest.lo $(MYLIBS)
227	$(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ dptest.lo $(LDFLAGS)
228
229
230dptsv : dptsv.lo $(MYLIBS)
231	$(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ dptsv.lo $(LDFLAGS)
232
233
234crmgr : crmgr.lo $(MYLIBS)
235	$(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ crmgr.lo $(LDFLAGS)
236
237
238crtest : crtest.lo $(MYLIBS)
239	$(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ crtest.lo $(LDFLAGS)
240
241
242crtsv : crtsv.lo $(MYLIBS)
243	$(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ crtsv.lo $(LDFLAGS)
244
245
246rlmgr : rlmgr.lo $(MYLIBS)
247	$(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ rlmgr.lo $(LDFLAGS)
248
249
250rltest : rltest.lo $(MYLIBS)
251	$(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ rltest.lo $(LDFLAGS)
252
253
254hvmgr : hvmgr.lo $(MYLIBS)
255	$(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ hvmgr.lo $(LDFLAGS)
256
257
258hvtest : hvtest.lo $(MYLIBS)
259	$(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ hvtest.lo $(LDFLAGS)
260
261
262cbtest : cbtest.lo $(MYLIBS)
263	$(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ cbtest.lo $(LDFLAGS)
264
265
266cbcodec : cbcodec.lo $(MYLIBS)
267	$(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ cbcodec.lo $(LDFLAGS)
268
269
270vlmgr : vlmgr.lo $(MYLIBS)
271	$(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ vlmgr.lo $(LDFLAGS)
272
273
274vltest : vltest.lo $(MYLIBS)
275	$(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ vltest.lo $(LDFLAGS)
276
277
278vltsv : vltsv.lo $(MYLIBS)
279	$(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ vltsv.lo $(LDFLAGS)
280
281
282odmgr : odmgr.lo $(MYLIBS)
283	$(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ odmgr.lo $(LDFLAGS)
284
285
286odtest : odtest.lo $(MYLIBS)
287	$(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ odtest.lo $(LDFLAGS)
288
289
290odidx : odidx.lo $(MYLIBS)
291	$(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ odidx.lo $(LDFLAGS)
292
293
294qmttest : qmttest.lo $(MYLIBS)
295	$(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ qmttest.lo $(LDFLAGS)
296
297
298depot.lo dpmgr.lo dptest.lo dptsv.lo : depot.h myconf.h
299
300curia.lo crmgr.lo crtest.lo crtsv.lo : curia.h depot.h myconf.h
301
302relic.lo rlmgr.lo rltest.lo : relic.h depot.h myconf.h
303
304hovel.lo hvmgr.lo hvtest.lo : hovel.h depot.h curia.h myconf.h
305
306cabin.lo cbtest.lo : cabin.h myconf.h
307
308villa.lo vlmgr.lo vltest.lo vltsv.lo : villa.h depot.h cabin.h myconf.h
309
310vista.lo : vista.h villa.h depot.h curia.h cabin.h myconf.h villa.c
311
312odeum.lo odmgr.lo odtest.lo odidx.lo : odeum.h depot.h curia.h cabin.h villa.h myconf.h
313
314myconf.lo : myconf.h
315
316
317
318# END OF FILE
319