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
95 pkginclude_HEADERS += bits.h
98 EXTRA_DIST += bits.in bits-testgen.c
99 tests:: bits.t bits.in
100 ./bits.t -f $(srcdir)/bits.in
102 check_PROGRAMS += bits.t
103 bits_t_SOURCES = bits.c
104 bits_t_CPPFLAGS = $(TEST_CPPFLAGS)
105 bits_t_LDFLAGS = -static
108 pkginclude_HEADERS += exc.h
109 libmLib_la_SOURCES += exc.c
113 pkginclude_HEADERS += str.h
114 libutils_la_SOURCES += str.c
117 ## Version comparison.
118 pkginclude_HEADERS += versioncmp.h
119 libmLib_la_SOURCES += versioncmp.c
120 LIBMANS += versioncmp.3
122 EXTRA_DIST += versioncmp.in
123 tests:: versioncmp.t versioncmp.in
124 ./versioncmp.t -f $(srcdir)/versioncmp.in
126 check_PROGRAMS += versioncmp.t
127 versioncmp_t_SOURCES = versioncmp-test.c
128 versioncmp_t_CPPFLAGS = $(TEST_CPPFLAGS)
129 versioncmp_t_LDFLAGS = -static
131 ###--------------------------------------------------------------------------
132 ### Memory allocation.
134 ## Memory allocation.
135 pkginclude_HEADERS += alloc.h arena.h sub.h
136 libmLib_la_SOURCES += alloc.c arena.c sub.c
137 LIBMANS += alloc.3 arena.3 sub.3
140 pkginclude_HEADERS += pool.h
141 libmLib_la_SOURCES += pool.c pool-file.c pool-sub.c
144 ###--------------------------------------------------------------------------
148 pkginclude_HEADERS += crc32.h
149 libmLib_la_SOURCES += crc32.c crc32-tab.c
152 bin_PROGRAMS += crc-mktab
153 crc_mktab_SOURCES = crc-mktab.c $(UTIL_SOURCES)
154 crc_mktab_LDADD = libutils.la
155 PROGMANS += crc-mktab.1
157 BUILT_SOURCES += crc32-tab.c
158 CLEANFILES += crc32-tab.c
159 crc32-tab.c: crc-mktab$(EXEEXT)
160 ./crc-mktab -o $@.new \
161 -p0x04c11db7 -b32 -B8 -r -c \
162 -scrc32_table -icrc32.h -tuint32 && \
165 ## Universal hashing.
166 pkginclude_HEADERS += unihash.h
167 libutils_la_SOURCES += unihash.c
168 libmLib_la_SOURCES += unihash-global.c
169 BUILT_SOURCES += unihash-global.c
172 bin_PROGRAMS += unihash-mkstatic
173 unihash_mkstatic_SOURCES = unihash-mkstatic.c
174 unihash_mkstatic_LDADD = libutils.la
175 PROGMANS += unihash-mkstatic.1
177 BUILT_SOURCES += unihash-global.c
178 CLEANFILES += unihash-global.c
179 unihash-global.c: unihash-mkstatic$(EXEEXT)
180 ./unihash-mkstatic -c -sunihash_global -iunihash.h -o$@.new && \
183 check_PROGRAMS += unihash.t
184 unihash_t_SOURCES = unihash.c
185 unihash_t_CPPFLAGS = $(TEST_CPPFLAGS)
186 unihash_t_LDFLAGS = -static
188 tests:: unihash.t unihash.in
189 ./unihash.t -f unihash.in
191 EXTRA_DIST += unihash-check.pl
192 CLEANFILES += unihash.in
193 unihash.in: unihash-check.pl
194 perl $(srcdir)/unihash-check.pl >$@.new && mv $@.new $@
196 ###--------------------------------------------------------------------------
200 pkginclude_HEADERS += dstr.h dspool.h
201 libmLib_la_SOURCES += dstr.c dputf.c dspool.c
202 LIBMANS += dstr.3 dspool.3
205 pkginclude_HEADERS += buf.h
206 libmLib_la_SOURCES += buf.c buf-dstr.c
210 pkginclude_HEADERS += darray.h
211 libmLib_la_SOURCES += darray.c
215 tests:: darray.t da.in da.ref
216 ./darray.t <da.in >da.out
220 check_PROGRAMS += darray.t
221 darray_t_SOURCES = da-test.c
222 darray_t_CPPFLAGS = $(TEST_CPPFLAGS)
223 darray_t_LDFLAGS = -static
225 EXTRA_DIST += da-gtest
228 perl $(srcdir)/da-gtest 10000 >$@.new && mv $@.new $@
233 perl $(srcdir)/da-ref <da.in >$@.new && mv $@.new $@
236 pkginclude_HEADERS += hash.h
237 libmLib_la_SOURCES += hash.c
241 pkginclude_HEADERS += sym.h
242 libmLib_la_SOURCES += sym.c
245 CLEANFILES += sym.out
246 tests:: sym.t sym.in sym.ref
247 ./sym.t <sym.in >sym.out
251 check_PROGRAMS += sym.t
252 sym_t_SOURCES = sym-test.c
253 sym_t_CPPFLAGS = $(TEST_CPPFLAGS)
254 sym_t_LDFLAGS = -static
256 EXTRA_DIST += sym-gtest
259 perl $(srcdir)/sym-gtest 10000 >$@.new && mv $@.new $@
261 EXTRA_DIST += sym-ref
262 CLEANFILES += sym.ref
263 sym.ref: sym-ref sym.in
264 perl $(srcdir)/sym-ref <sym.in >$@.new && mv $@.new $@
267 pkginclude_HEADERS += atom.h
268 libmLib_la_SOURCES += atom.c
271 ## Association tables.
272 pkginclude_HEADERS += assoc.h
273 libmLib_la_SOURCES += assoc.c
276 CLEANFILES += assoc.out
277 tests:: assoc.t sym.in sym.ref
278 ./assoc.t <sym.in >assoc.out
279 cmp assoc.out sym.ref
282 check_PROGRAMS += assoc.t
283 assoc_t_SOURCES = assoc-test.c
284 assoc_t_CPPFLAGS = $(TEST_CPPFLAGS)
285 assoc_t_LDFLAGS = -static
287 ###--------------------------------------------------------------------------
291 noinst_LTLIBRARIES += libmdwopt.la
292 pkginclude_HEADERS += mdwopt.h
293 libmdwopt_la_SOURCES = mdwopt.c
294 libmdwopt_la_CPPFLAGS = $(AM_CPPFLAGS) -DBUILDING_MLIB
295 libutils_la_LIBADD += libmdwopt.la
299 pkginclude_HEADERS += quis.h
300 libutils_la_SOURCES += quis.c pquis.c
304 pkginclude_HEADERS += report.h
305 libutils_la_SOURCES += report.c
308 ###--------------------------------------------------------------------------
309 ### Encoding and decoding.
312 pkginclude_HEADERS += url.h
313 libmLib_la_SOURCES += url.c
317 pkginclude_HEADERS += base64.h
318 libmLib_la_SOURCES += base64.c
321 EXTRA_DIST += base64.in base64.ref
322 CLEANFILES += base64.out
323 tests:: base64.t base64.in base64.ref
324 ./base64.t <$(srcdir)/base64.in >base64.out
325 cmp base64.out $(srcdir)/base64.ref
326 ./base64.t -d <$(srcdir)/base64.ref >base64.out
327 cmp base64.out $(srcdir)/base64.in
330 check_PROGRAMS += base64.t
331 base64_t_SOURCES = base64.c
332 base64_t_CPPFLAGS = $(TEST_CPPFLAGS)
333 base64_t_LDFLAGS = -static
336 pkginclude_HEADERS += base32.h
337 libmLib_la_SOURCES += base32.c
340 EXTRA_DIST += base32.in base32.ref
341 CLEANFILES += base32.out
342 tests:: base32.t base32.in base32.ref
343 ./base32.t <$(srcdir)/base32.in >base32.out
344 cmp base32.out $(srcdir)/base32.ref
345 ./base32.t -d <$(srcdir)/base32.ref >base32.out
346 cmp base32.out $(srcdir)/base32.in
349 check_PROGRAMS += base32.t
350 base32_t_SOURCES = base32.c
351 base32_t_CPPFLAGS = $(TEST_CPPFLAGS)
352 base32_t_LDFLAGS = -static
355 pkginclude_HEADERS += hex.h
356 libmLib_la_SOURCES += hex.c
359 EXTRA_DIST += hex.in hex.ref
360 CLEANFILES += hex.out
361 tests:: hex.t hex.in hex.ref
362 ./hex.t <$(srcdir)/hex.in >hex.out
363 cmp hex.out $(srcdir)/hex.ref
364 ./hex.t -d <$(srcdir)/hex.ref >hex.out
365 cmp hex.out $(srcdir)/hex.in
368 check_PROGRAMS += hex.t
369 hex_t_SOURCES = hex.c
370 hex_t_CPPFLAGS = $(TEST_CPPFLAGS)
371 hex_t_LDFLAGS = -static
373 ###--------------------------------------------------------------------------
374 ### System utilities.
377 pkginclude_HEADERS += daemonize.h
378 libmLib_la_SOURCES += daemonize.c
379 LIBMANS += daemonize.3
381 ## Environment variables.
382 pkginclude_HEADERS += env.h
383 libmLib_la_SOURCES += env.c
386 ## File and descriptor flags.
387 pkginclude_HEADERS += fdflags.h
388 libmLib_la_SOURCES += fdflags.c
391 ## File descriptor passing.
392 pkginclude_HEADERS += fdpass.h
393 libmLib_la_SOURCES += fdpass.c
396 ## Watching files for modification.
397 pkginclude_HEADERS += fwatch.h
398 libmLib_la_SOURCES += fwatch.c
402 pkginclude_HEADERS += lock.h
403 libmLib_la_SOURCES += lock.c
407 pkginclude_HEADERS += tv.h
408 libmLib_la_SOURCES += tv.c
411 ###--------------------------------------------------------------------------
415 pkginclude_HEADERS += lbuf.h
416 libmLib_la_SOURCES += lbuf.c
420 pkginclude_HEADERS += pkbuf.h
421 libmLib_la_SOURCES += pkbuf.c
424 ###--------------------------------------------------------------------------
425 ### Network utilities.
427 ## Core event selection.
428 pkginclude_HEADERS += sel.h
429 libmLib_la_SOURCES += sel.c
432 ## Waiting for buffers to fill.
433 pkginclude_HEADERS += selbuf.h selpk.h
434 libmLib_la_SOURCES += selbuf.c selpk.c
435 LIBMANS += selbuf.3 selpk.3
437 ## RFC931 identification.
438 pkginclude_HEADERS += ident.h
439 libmLib_la_SOURCES += ident.c
442 ## Nonblocking connections.
443 pkginclude_HEADERS += conn.h
444 libmLib_la_SOURCES += conn.c
448 pkginclude_HEADERS += sig.h
449 libmLib_la_SOURCES += sig.c
453 pkginclude_HEADERS += bres.h
457 libmLib_la_SOURCES += bres-adns.c
459 libmLib_la_SOURCES += bres.c
460 pkglibexec_PROGRAMS += bres
461 bres_SOURCES = bres.c
462 bres_CPPFLAGS = -DBRES_STANDALONE $(AM_CPPFLAGS)
466 ###--------------------------------------------------------------------------
467 ### Testing and debugging.
470 pkginclude_HEADERS += trace.h
471 libmLib_la_SOURCES += trace.c traceopt.c
475 pkginclude_HEADERS += track.h
476 libmLib_la_SOURCES += track.c
479 pkginclude_HEADERS += testrig.h
480 libmLib_la_SOURCES += testrig.c
483 ###--------------------------------------------------------------------------
486 EXTRA_DIST += $(LIBMANS) $(PROGMANS)
488 install-data-local: install-man
489 install-man: $(LIBMANS) $(PROGMANS)
491 $(mkinstalldirs) $(DESTDIR)$(mandir)
492 $(top_srcdir)/config/maninst \
493 -d $(DESTDIR)$(mandir) -s $(srcdir) \
496 $(top_srcdir)/config/maninst \
497 -d $(DESTDIR)$(mandir) -s $(srcdir) \
498 -i "$(INSTALL)" -e $(manext) \
502 uninstall-local: uninstall-man
505 $(top_srcdir)/config/maninst \
506 -d $(DESTDIR)$(mandir) -s $(srcdir) \
507 uninstall $(PROGMANS)
508 $(top_srcdir)/config/maninst \
509 -d $(DESTDIR)$(mandir) -s $(srcdir) -e $(manext) \
511 .PHONY: uninstall-man
513 ###--------------------------------------------------------------------------
518 echo $(VERSION) >$(distdir)/RELEASE
520 ## Additional build tools.
521 EXTRA_DIST += config/confsubst
522 EXTRA_DIST += config/auto-version
523 EXTRA_DIST += config/maninst
525 ###--------------------------------------------------------------------------
529 EXTRA_DIST += debian/rules debian/copyright
530 EXTRA_DIST += debian/control debian/changelog
531 EXTRA_DIST += debian/mlib2.install
532 EXTRA_DIST += debian/mlib2-adns.install
533 EXTRA_DIST += debian/mlib-dev.install
534 EXTRA_DIST += debian/mlib-bin.install
536 ##----- That's all, folks ---------------------------------------------------