## it under the terms of the GNU Library General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
-##
+##
## mLib is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU Library General Public License for more details.
-##
+##
## You should have received a copy of the GNU Library General Public
## License along with mLib; if not, write to the Free
## Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
## --- What to build ---
SUBDIRS = man
-
-bin_SCRIPTS = mLib-config
bin_PROGRAMS = crc-mktab unihash-mkstatic
lib_LTLIBRARIES = libmLib.la
pkglibexecdir = $(libexecdir)/$(PACKAGE)
pkglibexec_PROGRAMS = @BRES_LIBEXEC@
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = mLib.pc
EXTRA_PROGRAMS = bres
pkginclude_HEADERS = \
- align.h alloc.h arena.h bits.h exc.h macros.h quis.h report.h sub.h \
+ align.h alloc.h arena.h bits.h buf.h exc.h macros.h quis.h \
+ report.h sub.h \
trace.h track.h unihash.h \
pool.h \
atom.h assoc.h darray.h dstr.h dspool.h hash.h sym.h crc32.h \
+ daemonize.h versioncmp.h \
env.h fdflags.h fdpass.h fwatch.h lock.h \
bres.h conn.h lbuf.h ident.h pkbuf.h sel.h selbuf.h selpk.h sig.h \
tv.h \
## --- Things to put in the library ---
-libmLib_la_LDFLAGS = -version-info 2:3:0
+libmLib_la_LDFLAGS = -version-info 2:5:0
## Middle number is the patchlevel. Final number is the minor version. The
## difference between the first and last numbers is major version.
libmLib_la_SOURCES = \
- alloc.c arena.c exc.c quis.c pquis.c report.c sub.c trace.c \
+ alloc.c arena.c buf.c exc.c quis.c pquis.c report.c sub.c trace.c \
traceopt.c track.c \
pool.c pool-file.c pool-sub.c \
- atom.c assoc.c darray.c dstr.c dputf.c dspool.c hash.c sym.c \
+ atom.c assoc.c buf-dstr.c darray.c dstr.c dputf.c dspool.c hash.c \
+ sym.c \
crc32.c crc32-tab.c \
unihash.c unihash-global.c \
+ daemonize.c versioncmp.c \
env.c fdflags.c fdpass.c fwatch.c lock.c \
@BRES_SOURCE@.c \
conn.c lbuf.c ident.c pkbuf.c sel.c selbuf.c selpk.c sig.c \
BUILT_SOURCES = crc32-tab.c unihash-global.c
-crc32-tab.c: crc-mktab
+crc32-tab.c: crc-mktab$(EXEEXT)
./crc-mktab \
-p0x04c11db7 -b32 -B8 -r \
-c -scrc32_table -icrc32.h -tuint32 -ocrc32-tab.c.new
mv crc32-tab.c.new crc32-tab.c
-unihash-global.c: unihash-mkstatic
+unihash-global.c: unihash-mkstatic$(EXEEXT)
./unihash-mkstatic \
-c -sunihash_global -iunihash.h -ounihash-global.c.new
mv unihash-global.c.new unihash-global.c
crc_mktab_SOURCES = \
crc-mktab.c \
mdwopt.c quis.c pquis.c report.c str.c
+crc_mktab_CFLAGS = $(AM_CFLAGS)
unihash_mkstatic_SOURCES = \
unihash-mkstatic.c \
mdwopt.c quis.c pquis.c report.c str.c unihash.c
+unihash_mkstatic_CFLAGS = $(AM_CFLAGS)
## --- Test code ---
-noinst_PROGRAMS = da.t sym.t assoc.t bits.t
+noinst_PROGRAMS = da.t sym.t assoc.t bits.t versioncmp.t
check: \
da.test sym.test assoc.test bits.test base64.test hex.test \
- base32.test \
+ base32.test versioncmp.test \
unihash.test
da_t_SOURCES = da-test.c
bits.test: bits.t
./bits.t -f $(srcdir)/bits.in
+versioncmp_t_SOURCES = versioncmp-test.c
+versioncmp_t_LDADD = libmLib.la
+versioncmp_t_LDFLAGS = -static
+versioncmp-test.o: versioncmp-test.c
+ $(COMPILE) -c -DSRCDIR="\"$(srcdir)\"" $(srcdir)/versioncmp-test.c -o $@
+versioncmp.test: versioncmp.t
+ ./versioncmp.t -f $(srcdir)/versioncmp.in
+
base64.to: base64.c
$(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \
$(srcdir)/base64.c -o base64.to
./unihash.t -f $(srcdir)/unihash.in
TEST_CLEAN = \
- *.t *.to \
+ *.t *.to assoc.out \
da.in da.ref da.out \
sym.in sym.ref sym.out \
base64.out base32.out hex.out unihash.in
## I must (a) build the standalone version, and (b) inform the client library
## where the standalone version is.
-bres$(EXEEXT): bres-stnd.o
- $(LINK) -o bres bres-stnd.o $(LIBS)
-
-bres-stnd.o: $(srcdir)/bres.c
- $(COMPILE) -c -DBRES_STANDALONE -o bres-stnd.o $(srcdir)/bres.c
+bres_SOURCES = bres.c
+bres_CFLAGS = -DBRES_STANDALONE
bres.lo: $(srcdir)/bres.c
$(LTCOMPILE) -c -DBRES_SERVER="\"$(libexecdir)/$(PACKAGE)/`echo bres|sed '$(transform)'`\"" $(srcdir)/bres.c
uninstall-man:
(cd man && $(MAKE) uninstall-man)
-CLEANFILES = $(TEST_CLEAN) crc32-tab.c
+CLEANFILES = $(TEST_CLEAN) crc32-tab.c unihash-global.c
DISTCLEANFILES = libtool
EXTRA_DIST = \
$(TEST_DIST) maninst \