3 ### Building the distribution
5 ### (c) 1998 Straylight/Edgeware
8 ###----- Licensing notice ---------------------------------------------------
10 ### This file is part of the mLib utilities library.
12 ### mLib is free software; you can redistribute it and/or modify
13 ### it under the terms of the GNU Library General Public License as
14 ### published by the Free Software Foundation; either version 2 of the
15 ### License, or (at your option) any later version.
17 ### mLib is distributed in the hope that it will be useful,
18 ### but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ### GNU Library General Public License for more details.
22 ### You should have received a copy of the GNU Library General Public
23 ### License along with mLib; if not, write to the Free
24 ### Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
25 ### MA 02111-1307, USA.
27 pkglibexecdir = $(libexecdir)/$(PACKAGE)
43 confsubst = $(top_srcdir)/config/confsubst
46 prefix=$(prefix) exec_prefix=$(exec_prefix) \
47 libdir=$(libdir) includedir=$(includedir) \
48 bindir=$(bindir) sbindir=$(sbindir) \
49 PACKAGE=$(PACKAGE) VERSION=$(VERSION)
51 ###--------------------------------------------------------------------------
54 lib_LTLIBRARIES += libmLib.la
55 libmLib_la_LDFLAGS = -version-info $(LIBTOOL_VERSION_INFO)
59 pkgconfigdir = $(libdir)/pkgconfig
60 pkgconfig_DATA = mLib.pc
61 EXTRA_DIST += mLib.pc.in
64 mLib.pc: mLib.pc.in Makefile
65 $(confsubst) $(srcdir)/mLib.pc.in >$@.new $(SUBSTITUTIONS) && \
68 ###--------------------------------------------------------------------------
74 TEST_CPPFLAGS = -DTEST_RIG -DSRCDIR="\"(srcdir)\"" $(AM_CPPFLAGS)
78 ###--------------------------------------------------------------------------
81 noinst_LTLIBRARIES += libutils.la
84 libmLib_la_LIBADD += libutils.la
87 pkginclude_HEADERS += macros.h
91 pkginclude_HEADERS += align.h
94 pkginclude_HEADERS += bits.h
97 EXTRA_DIST += bits.in bits-testgen.c
98 tests:: bits.t bits.in
99 ./bits.t -f $(srcdir)/bits.in
101 check_PROGRAMS += bits.t
102 bits_t_SOURCES = bits.c
103 bits_t_CPPFLAGS = $(TEST_CPPFLAGS)
104 bits_t_LDFLAGS = -static
107 pkginclude_HEADERS += exc.h
108 libmLib_la_SOURCES += exc.c
112 pkginclude_HEADERS += str.h
113 libutils_la_SOURCES += str.c
116 ## Version comparison.
117 pkginclude_HEADERS += versioncmp.h
118 libmLib_la_SOURCES += versioncmp.c
119 LIBMANS += versioncmp.3
121 EXTRA_DIST += versioncmp.in
122 tests:: versioncmp.t versioncmp.in
123 ./versioncmp.t -f $(srcdir)/versioncmp.in
125 check_PROGRAMS += versioncmp.t
126 versioncmp_t_SOURCES = versioncmp-test.c
127 versioncmp_t_CPPFLAGS = $(TEST_CPPFLAGS)
128 versioncmp_t_LDFLAGS = -static
130 ###--------------------------------------------------------------------------
131 ### Memory allocation.
133 ## Memory allocation.
134 pkginclude_HEADERS += alloc.h arena.h sub.h
135 libmLib_la_SOURCES += alloc.c arena.c sub.c
136 LIBMANS += alloc.3 arena.3 sub.3
139 pkginclude_HEADERS += pool.h
140 libmLib_la_SOURCES += pool.c pool-file.c pool-sub.c
143 ###--------------------------------------------------------------------------
147 pkginclude_HEADERS += crc32.h
148 libmLib_la_SOURCES += crc32.c crc32-tab.c
151 bin_PROGRAMS += crc-mktab
152 crc_mktab_SOURCES = crc-mktab.c $(UTIL_SOURCES)
153 crc_mktab_LDADD = libutils.la
154 PROGMANS += crc-mktab.1
156 BUILT_SOURCES += crc32-tab.c
157 CLEANFILES += crc32-tab.c
158 crc32-tab.c: crc-mktab$(EXEEXT)
159 ./crc-mktab -o $@.new \
160 -p0x04c11db7 -b32 -B8 -r -c \
161 -scrc32_table -icrc32.h -tuint32 && \
164 ## Universal hashing.
165 pkginclude_HEADERS += unihash.h
166 libutils_la_SOURCES += unihash.c
167 libmLib_la_SOURCES += unihash-global.c
168 BUILT_SOURCES += unihash-global.c
171 bin_PROGRAMS += unihash-mkstatic
172 unihash_mkstatic_SOURCES = unihash-mkstatic.c
173 unihash_mkstatic_LDADD = libutils.la
174 PROGMANS += unihash-mkstatic.1
176 BUILT_SOURCES += unihash-global.c
177 CLEANFILES += unihash-global.c
178 unihash-global.c: unihash-mkstatic$(EXEEXT)
179 ./unihash-mkstatic -c -sunihash_global -iunihash.h -o$@.new && \
182 check_PROGRAMS += unihash.t
183 unihash_t_SOURCES = unihash.c
184 unihash_t_CPPFLAGS = $(TEST_CPPFLAGS)
185 unihash_t_LDFLAGS = -static
187 tests:: unihash.t unihash.in
188 ./unihash.t -f unihash.in
190 EXTRA_DIST += unihash-check.pl
191 CLEANFILES += unihash.in
192 unihash.in: unihash-check.pl
193 perl $(srcdir)/unihash-check.pl >$@.new && mv $@.new $@
195 ###--------------------------------------------------------------------------
199 pkginclude_HEADERS += dstr.h dspool.h
200 libmLib_la_SOURCES += dstr.c dputf.c dspool.c
201 LIBMANS += dstr.3 dspool.3
204 pkginclude_HEADERS += buf.h
205 libmLib_la_SOURCES += buf.c buf-dstr.c
209 pkginclude_HEADERS += darray.h
210 libmLib_la_SOURCES += darray.c
214 tests:: darray.t da.in da.ref
215 ./darray.t <da.in >da.out
219 check_PROGRAMS += darray.t
220 darray_t_SOURCES = da-test.c
221 darray_t_CPPFLAGS = $(TEST_CPPFLAGS)
222 darray_t_LDFLAGS = -static
224 EXTRA_DIST += da-gtest
227 perl $(srcdir)/da-gtest 10000 >$@.new && mv $@.new $@
232 perl $(srcdir)/da-ref <da.in >$@.new && mv $@.new $@
235 pkginclude_HEADERS += hash.h
236 libmLib_la_SOURCES += hash.c
240 pkginclude_HEADERS += sym.h
241 libmLib_la_SOURCES += sym.c
244 CLEANFILES += sym.out
245 tests:: sym.t sym.in sym.ref
246 ./sym.t <sym.in >sym.out
250 check_PROGRAMS += sym.t
251 sym_t_SOURCES = sym-test.c
252 sym_t_CPPFLAGS = $(TEST_CPPFLAGS)
253 sym_t_LDFLAGS = -static
255 EXTRA_DIST += sym-gtest
258 perl $(srcdir)/sym-gtest 10000 >$@.new && mv $@.new $@
260 EXTRA_DIST += sym-ref
261 CLEANFILES += sym.ref
262 sym.ref: sym-ref sym.in
263 perl $(srcdir)/sym-ref <sym.in >$@.new && mv $@.new $@
266 pkginclude_HEADERS += atom.h
267 libmLib_la_SOURCES += atom.c
270 ## Association tables.
271 pkginclude_HEADERS += assoc.h
272 libmLib_la_SOURCES += assoc.c
275 CLEANFILES += assoc.out
276 tests:: assoc.t sym.in sym.ref
277 ./assoc.t <sym.in >assoc.out
278 cmp assoc.out sym.ref
281 check_PROGRAMS += assoc.t
282 assoc_t_SOURCES = assoc-test.c
283 assoc_t_CPPFLAGS = $(TEST_CPPFLAGS)
284 assoc_t_LDFLAGS = -static
286 ###--------------------------------------------------------------------------
290 noinst_LTLIBRARIES += libmdwopt.la
291 pkginclude_HEADERS += mdwopt.h
292 libmdwopt_la_SOURCES = mdwopt.c
293 libmdwopt_la_CPPFLAGS = $(AM_CPPFLAGS) -DBUILDING_MLIB
294 libutils_la_LIBADD += libmdwopt.la
298 pkginclude_HEADERS += quis.h
299 libutils_la_SOURCES += quis.c pquis.c
303 pkginclude_HEADERS += report.h
304 libutils_la_SOURCES += report.c
307 ###--------------------------------------------------------------------------
308 ### Encoding and decoding.
311 pkginclude_HEADERS += url.h
312 libmLib_la_SOURCES += url.c
316 pkginclude_HEADERS += base64.h
317 libmLib_la_SOURCES += base64.c
320 EXTRA_DIST += base64.in base64.ref
321 CLEANFILES += base64.out
322 tests:: base64.t base64.in base64.ref
323 ./base64.t <$(srcdir)/base64.in >base64.out
324 cmp base64.out $(srcdir)/base64.ref
325 ./base64.t -d <$(srcdir)/base64.ref >base64.out
326 cmp base64.out $(srcdir)/base64.in
329 check_PROGRAMS += base64.t
330 base64_t_SOURCES = base64.c
331 base64_t_CPPFLAGS = $(TEST_CPPFLAGS)
332 base64_t_LDFLAGS = -static
335 pkginclude_HEADERS += base32.h
336 libmLib_la_SOURCES += base32.c
339 EXTRA_DIST += base32.in base32.ref
340 CLEANFILES += base32.out
341 tests:: base32.t base32.in base32.ref
342 ./base32.t <$(srcdir)/base32.in >base32.out
343 cmp base32.out $(srcdir)/base32.ref
344 ./base32.t -d <$(srcdir)/base32.ref >base32.out
345 cmp base32.out $(srcdir)/base32.in
348 check_PROGRAMS += base32.t
349 base32_t_SOURCES = base32.c
350 base32_t_CPPFLAGS = $(TEST_CPPFLAGS)
351 base32_t_LDFLAGS = -static
354 pkginclude_HEADERS += hex.h
355 libmLib_la_SOURCES += hex.c
358 EXTRA_DIST += hex.in hex.ref
359 CLEANFILES += hex.out
360 tests:: hex.t hex.in hex.ref
361 ./hex.t <$(srcdir)/hex.in >hex.out
362 cmp hex.out $(srcdir)/hex.ref
363 ./hex.t -d <$(srcdir)/hex.ref >hex.out
364 cmp hex.out $(srcdir)/hex.in
367 check_PROGRAMS += hex.t
368 hex_t_SOURCES = hex.c
369 hex_t_CPPFLAGS = $(TEST_CPPFLAGS)
370 hex_t_LDFLAGS = -static
372 ###--------------------------------------------------------------------------
373 ### System utilities.
376 pkginclude_HEADERS += daemonize.h
377 libmLib_la_SOURCES += daemonize.c
378 LIBMANS += daemonize.3
380 ## Environment variables.
381 pkginclude_HEADERS += env.h
382 libmLib_la_SOURCES += env.c
385 ## File and descriptor flags.
386 pkginclude_HEADERS += fdflags.h
387 libmLib_la_SOURCES += fdflags.c
390 ## File descriptor passing.
391 pkginclude_HEADERS += fdpass.h
392 libmLib_la_SOURCES += fdpass.c
395 ## Watching files for modification.
396 pkginclude_HEADERS += fwatch.h
397 libmLib_la_SOURCES += fwatch.c
401 pkginclude_HEADERS += lock.h
402 libmLib_la_SOURCES += lock.c
406 pkginclude_HEADERS += tv.h
407 libmLib_la_SOURCES += tv.c
410 ###--------------------------------------------------------------------------
414 pkginclude_HEADERS += lbuf.h
415 libmLib_la_SOURCES += lbuf.c
419 pkginclude_HEADERS += pkbuf.h
420 libmLib_la_SOURCES += pkbuf.c
423 ###--------------------------------------------------------------------------
424 ### Network utilities.
426 ## Core event selection.
427 pkginclude_HEADERS += sel.h
428 libmLib_la_SOURCES += sel.c
431 ## Waiting for buffers to fill.
432 pkginclude_HEADERS += selbuf.h selpk.h
433 libmLib_la_SOURCES += selbuf.c selpk.c
434 LIBMANS += selbuf.3 selpk.3
436 ## RFC931 identification.
437 pkginclude_HEADERS += ident.h
438 libmLib_la_SOURCES += ident.c
441 ## Nonblocking connections.
442 pkginclude_HEADERS += conn.h
443 libmLib_la_SOURCES += conn.c
447 pkginclude_HEADERS += sig.h
448 libmLib_la_SOURCES += sig.c
452 pkginclude_HEADERS += bres.h
456 libmLib_la_SOURCES += bres-adns.c
458 libmLib_la_SOURCES += bres.c
459 pkglibexec_PROGRAMS += bres
460 bres_SOURCES = bres.c
461 bres_CPPFLAGS = -DBRES_STANDALONE $(AM_CPPFLAGS)
465 ###--------------------------------------------------------------------------
466 ### Testing and debugging.
469 pkginclude_HEADERS += trace.h
470 libmLib_la_SOURCES += trace.c traceopt.c
474 pkginclude_HEADERS += track.h
475 libmLib_la_SOURCES += track.c
478 pkginclude_HEADERS += testrig.h
479 libmLib_la_SOURCES += testrig.c
482 ###--------------------------------------------------------------------------
485 EXTRA_DIST += $(LIBMANS) $(PROGMANS)
487 install-data-local: install-man
488 install-man: $(LIBMANS) $(PROGMANS)
490 $(mkinstalldirs) $(DESTDIR)$(mandir)
491 $(top_srcdir)/config/maninst \
492 -d $(DESTDIR)$(mandir) -s $(srcdir) \
495 $(top_srcdir)/config/maninst \
496 -d $(DESTDIR)$(mandir) -s $(srcdir) \
497 -i "$(INSTALL)" -e $(manext) \
501 uninstall-local: uninstall-man
504 $(top_srcdir)/config/maninst \
505 -d $(DESTDIR)$(mandir) -s $(srcdir) \
506 uninstall $(PROGMANS)
507 $(top_srcdir)/config/maninst \
508 -d $(DESTDIR)$(mandir) -s $(srcdir) -e $(manext) \
510 .PHONY: uninstall-man
512 ###--------------------------------------------------------------------------
517 echo $(VERSION) >$(distdir)/RELEASE
519 ## Additional build tools.
520 EXTRA_DIST += config/confsubst
521 EXTRA_DIST += config/auto-version
522 EXTRA_DIST += config/maninst
524 ###--------------------------------------------------------------------------
528 EXTRA_DIST += debian/rules debian/copyright
529 EXTRA_DIST += debian/control debian/changelog
530 EXTRA_DIST += debian/mlib2.install
531 EXTRA_DIST += debian/mlib2-adns.install
532 EXTRA_DIST += debian/mlib-dev.install
533 EXTRA_DIST += debian/mlib-bin.install
535 ##----- That's all, folks ---------------------------------------------------