|
| 1 | +# Makefile to build QDBM using libtool |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +#================================================================ |
| 6 | +# Setting variables |
| 7 | +#================================================================ |
| 8 | + |
| 9 | + |
| 10 | +# Generic settings |
| 11 | +SHELL = @SHELL@ |
| 12 | + |
| 13 | +# Packaging |
| 14 | +PACKAGE = @PACKAGE_NAME@ |
| 15 | +VERSION = @PACKAGE_VERSION@ |
| 16 | +LIBVER = @LIBVER@ |
| 17 | +LIBREV = @LIBREV@ |
| 18 | + |
| 19 | +# Targets |
| 20 | +MYHEADS = depot.h curia.h relic.h hovel.h cabin.h villa.h vista.h odeum.h |
| 21 | +MYLIBOBJS = depot.lo curia.lo relic.lo hovel.lo cabin.lo villa.lo vista.lo odeum.lo myconf.lo |
| 22 | +MYLIBS = libqdbm.la |
| 23 | +MYBINS = dpmgr dptest dptsv crmgr crtest crtsv rlmgr rltest hvmgr hvtest \ |
| 24 | + cbtest cbcodec vlmgr vltest vltsv odmgr odtest odidx qmttest |
| 25 | +MYMAN1S = 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 |
| 27 | +MYMAN3S = 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 |
| 29 | +MYDOCS = spex.html spex-ja.html COPYING ChangeLog NEWS THANKS |
| 30 | +MYPCS = qdbm.pc |
| 31 | + |
| 32 | +# Install destinations |
| 33 | +prefix = @prefix@ |
| 34 | +exec_prefix = @exec_prefix@ |
| 35 | +MYHEADDIR = @includedir@ |
| 36 | +MYLIBDIR = @libdir@ |
| 37 | +MYBINDIR = @bindir@ |
| 38 | +MYMAN1DIR = @mandir@/man1 |
| 39 | +MYMAN3DIR = @mandir@/man3 |
| 40 | +MYSHAREDIR = $(prefix)/share/$(PACKAGE) |
| 41 | +MYPCDIR = @libdir@/pkgconfig |
| 42 | + |
| 43 | +# Building binaries |
| 44 | +LIBTOOL = libtool |
| 45 | +CC = gcc |
| 46 | +CFLAGS = -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 |
| 50 | +LD = gcc |
| 51 | +LIBLDFLAGS = -rpath $(MYLIBDIR) -R $(MYLIBDIR) \ |
| 52 | + -version-info $$(($(LIBVER)+$(LIBREV))):0:$(LIBREV) @LIBS@ |
| 53 | +LDFLAGS = -rpath $(MYLIBDIR) -R $(MYLIBDIR) -L. -lqdbm @LIBS@ |
| 54 | +INSTALL = install |
| 55 | +MKDIR = mkdir -p |
| 56 | +CP = cp -rf |
| 57 | +RM = 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 | + |
| 79 | +all : $(MYLIBS) $(MYBINS) |
| 80 | + @printf '\n' |
| 81 | + @printf '#================================================================\n' |
| 82 | + @printf '# Ready to install.\n' |
| 83 | + @printf '#================================================================\n' |
| 84 | + |
| 85 | + |
| 86 | +clean : |
| 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 | + |
| 91 | +install : |
| 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 | + |
| 109 | +uninstall : |
| 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 | + |
| 119 | +distclean : clean |
| 120 | + $(RM) Makefile LTmakefile rpmspec config.cache config.log config.status autom4te.cache |
| 121 | + |
| 122 | + |
| 123 | +check : |
| 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 | + |
| 218 | +libqdbm.la : $(MYLIBOBJS) |
| 219 | + $(LIBTOOL) --mode=link --tag=CC $(LD) $(MYLIBOBJS) -o $@ $(LIBLDFLAGS) |
| 220 | + |
| 221 | + |
| 222 | +dpmgr : dpmgr.lo $(MYLIBS) |
| 223 | + $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ dpmgr.lo $(LDFLAGS) |
| 224 | + |
| 225 | + |
| 226 | +dptest : dptest.lo $(MYLIBS) |
| 227 | + $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ dptest.lo $(LDFLAGS) |
| 228 | + |
| 229 | + |
| 230 | +dptsv : dptsv.lo $(MYLIBS) |
| 231 | + $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ dptsv.lo $(LDFLAGS) |
| 232 | + |
| 233 | + |
| 234 | +crmgr : crmgr.lo $(MYLIBS) |
| 235 | + $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ crmgr.lo $(LDFLAGS) |
| 236 | + |
| 237 | + |
| 238 | +crtest : crtest.lo $(MYLIBS) |
| 239 | + $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ crtest.lo $(LDFLAGS) |
| 240 | + |
| 241 | + |
| 242 | +crtsv : crtsv.lo $(MYLIBS) |
| 243 | + $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ crtsv.lo $(LDFLAGS) |
| 244 | + |
| 245 | + |
| 246 | +rlmgr : rlmgr.lo $(MYLIBS) |
| 247 | + $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ rlmgr.lo $(LDFLAGS) |
| 248 | + |
| 249 | + |
| 250 | +rltest : rltest.lo $(MYLIBS) |
| 251 | + $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ rltest.lo $(LDFLAGS) |
| 252 | + |
| 253 | + |
| 254 | +hvmgr : hvmgr.lo $(MYLIBS) |
| 255 | + $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ hvmgr.lo $(LDFLAGS) |
| 256 | + |
| 257 | + |
| 258 | +hvtest : hvtest.lo $(MYLIBS) |
| 259 | + $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ hvtest.lo $(LDFLAGS) |
| 260 | + |
| 261 | + |
| 262 | +cbtest : cbtest.lo $(MYLIBS) |
| 263 | + $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ cbtest.lo $(LDFLAGS) |
| 264 | + |
| 265 | + |
| 266 | +cbcodec : cbcodec.lo $(MYLIBS) |
| 267 | + $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ cbcodec.lo $(LDFLAGS) |
| 268 | + |
| 269 | + |
| 270 | +vlmgr : vlmgr.lo $(MYLIBS) |
| 271 | + $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ vlmgr.lo $(LDFLAGS) |
| 272 | + |
| 273 | + |
| 274 | +vltest : vltest.lo $(MYLIBS) |
| 275 | + $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ vltest.lo $(LDFLAGS) |
| 276 | + |
| 277 | + |
| 278 | +vltsv : vltsv.lo $(MYLIBS) |
| 279 | + $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ vltsv.lo $(LDFLAGS) |
| 280 | + |
| 281 | + |
| 282 | +odmgr : odmgr.lo $(MYLIBS) |
| 283 | + $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ odmgr.lo $(LDFLAGS) |
| 284 | + |
| 285 | + |
| 286 | +odtest : odtest.lo $(MYLIBS) |
| 287 | + $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ odtest.lo $(LDFLAGS) |
| 288 | + |
| 289 | + |
| 290 | +odidx : odidx.lo $(MYLIBS) |
| 291 | + $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ odidx.lo $(LDFLAGS) |
| 292 | + |
| 293 | + |
| 294 | +qmttest : qmttest.lo $(MYLIBS) |
| 295 | + $(LIBTOOL) --mode=link --tag=CC $(LD) -o $@ qmttest.lo $(LDFLAGS) |
| 296 | + |
| 297 | + |
| 298 | +depot.lo dpmgr.lo dptest.lo dptsv.lo : depot.h myconf.h |
| 299 | + |
| 300 | +curia.lo crmgr.lo crtest.lo crtsv.lo : curia.h depot.h myconf.h |
| 301 | + |
| 302 | +relic.lo rlmgr.lo rltest.lo : relic.h depot.h myconf.h |
| 303 | + |
| 304 | +hovel.lo hvmgr.lo hvtest.lo : hovel.h depot.h curia.h myconf.h |
| 305 | + |
| 306 | +cabin.lo cbtest.lo : cabin.h myconf.h |
| 307 | + |
| 308 | +villa.lo vlmgr.lo vltest.lo vltsv.lo : villa.h depot.h cabin.h myconf.h |
| 309 | + |
| 310 | +vista.lo : vista.h villa.h depot.h curia.h cabin.h myconf.h villa.c |
| 311 | + |
| 312 | +odeum.lo odmgr.lo odtest.lo odidx.lo : odeum.h depot.h curia.h cabin.h villa.h myconf.h |
| 313 | + |
| 314 | +myconf.lo : myconf.h |
| 315 | + |
| 316 | + |
| 317 | + |
| 318 | +# END OF FILE |
0 commit comments