chiark / gitweb /
Fixes for Cygwin.
[mLib] / Makefile.am
index db7de366aaf41b6c1c5c8e3a563f72cb9933cb14..aa3aa1d74f7df626379ec2cdfe23c3be9d13bbca 100644 (file)
@@ -1,6 +1,6 @@
 ## -*-Makefile-*-
 ##
-## $Id: Makefile.am,v 1.46 2004/04/08 01:36:11 mdw Exp $
+## $Id$
 ##
 ## Building the distribution
 ##
@@ -50,7 +50,7 @@ pkginclude_HEADERS = \
        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 \
-       base64.h hex.h mdwopt.h str.h testrig.h url.h
+       base64.h base32.h hex.h mdwopt.h str.h testrig.h url.h
 
 ## --- Things to put in the library ---
 
@@ -69,19 +69,19 @@ libmLib_la_SOURCES = \
        @BRES_SOURCE@.c \
        conn.c lbuf.c ident.c pkbuf.c sel.c selbuf.c selpk.c sig.c \
        tv.c \
-       base64.c hex.c mdwopt.c str.c testrig.c url.c
+       base64.c base32.c hex.c mdwopt.c str.c testrig.c url.c
 EXTRA_libmLib_la_SOURCES = bres.c bres-adns.c
 libmLib_la_LIBADD = @DEPLIBS@
 
 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
@@ -89,9 +89,11 @@ unihash-global.c: unihash-mkstatic
 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 ---
 
@@ -99,6 +101,7 @@ noinst_PROGRAMS = da.t sym.t assoc.t bits.t
 
 check: \
        da.test sym.test assoc.test bits.test base64.test hex.test \
+       base32.test \
        unihash.test
 
 da_t_SOURCES = da-test.c
@@ -158,6 +161,19 @@ base64.test: base64.t base64.in base64.ref
        cmp base64.out $(srcdir)/base64.in
        @echo "base64 tested OK."
 
+base32.to: base32.c
+       $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \
+               $(srcdir)/base32.c -o base32.to
+base32.t: base32.to base32.o libmLib.la
+       $(CC) $(CFLAGS) $(LDFLAGS) \
+               base32.to .libs/libmLib.a $(LIBS) -o base32.t
+base32.test: base32.t base32.in base32.ref
+       ./base32.t <$(srcdir)/base32.in >base32.out
+       cmp base32.out $(srcdir)/base32.ref
+       ./base32.t -d <$(srcdir)/base32.ref >base32.out
+       cmp base32.out $(srcdir)/base32.in
+       @echo "base32 tested OK."
+
 hex.to: hex.c
        $(COMPILE) -c -DTEST_RIG -DSRCDIR=\"$(srcdir)\" \
                $(srcdir)/hex.c -o hex.to
@@ -179,32 +195,30 @@ unihash.t: unihash.to libmLib.la
                unihash.to .libs/libmLib.a $(LIBS) -o unihash.t
 unihash.in: unihash-check.pl
        perl $(srcdir)/unihash-check.pl >unihash.in.new
-       mv unihash.in.new unihash.in
+       mv unihash.in.new $(srcdir)/unihash.in
 unihash.test: unihash.t unihash.in
-       ./unihash.t -f unihash.in
+       ./unihash.t -f $(srcdir)/unihash.in
 
 TEST_CLEAN = \
        *.t *.to \
        da.in da.ref da.out \
        sym.in sym.ref sym.out \
-       base64.out hex.out unihash.in
+       base64.out base32.out hex.out unihash.in
 
 TEST_DIST = \
        da-gtest da-ref \
        sym-gtest sym-ref \
        bits.in bits-testgen.c \
-       base64.in base64.ref hex.in hex.ref
+       unihash-check.pl unihash.in \
+       base64.in base64.ref base32.in base32.ref hex.in hex.ref
 
 ## --- Background resolver ---
 ##
 ## 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