chiark / gitweb /
codec, baseconv: Cleanup of the various binary encoding functions.
[mLib] / codec / Makefile.am
CommitLineData
18c831dc
MW
1### -*-makefile-*-
2###
3### Build script for encoding and decoding
4###
5### (c) 2009 Straylight/Edgeware
6###
7
8###----- Licensing notice ---------------------------------------------------
9###
10### This file is part of the mLib utilities library.
11###
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.
16###
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.
21###
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.
26
27include $(top_srcdir)/vars.am
28
29noinst_LTLIBRARIES = libcodec.la
30libcodec_la_SOURCES =
31
32###--------------------------------------------------------------------------
33### Component files.
34
236f657b
MW
35## Codec base.
36pkginclude_HEADERS += codec.h
37libcodec_la_SOURCES += codec.c
38LIBMANS += codec.3
39
40## null
41libcodec_la_SOURCES += null-codec.c
42
43## Simple binary base-conversion codecs.
44pkginclude_HEADERS += base64.h base32.h hex.h
45libcodec_la_SOURCES += baseconv.c
46LIBMANS += base64.3
47
18c831dc
MW
48## form-urlencoded
49pkginclude_HEADERS += url.h
50libcodec_la_SOURCES += url.c
51LIBMANS += url.3
52
236f657b
MW
53## Test program.
54bin_PROGRAMS += bincode
55PROGMANS += bincode.1
18c831dc 56
236f657b
MW
57bincode_SOURCES = bincode.c
58bincode_LDADD = libcodec.la
59bincode_LDADD += ../mem/libmem.la
60bincode_LDADD += ../struct/libstruct.la
61bincode_LDADD += $(UTIL_LIBS)
18c831dc 62
236f657b
MW
63EXTRA_DIST += base64.in base32.in hex.in
64EXTRA_DIST += base64.ref base32.ref hex.ref
65CLEANFILES += base64.out base32.out hex.out
18c831dc 66
236f657b
MW
67TEST_CODECS = base64 base32 hex
68tests:: bincode
69 set -e; \
70 for codec in $(TEST_CODECS); do \
71 case $$codec in \
72 hex) flags=lowerc,ignjunk width=64 ;; \
73 base32) flags=ignjunk width=32 ;; \
74 *) flags=ignjunk width=64 ;; \
75 esac; \
76 ./bincode -e -i'\t' -f$$flags -m$$width -o$$codec.out $$codec \
77 $(srcdir)/$$codec.in; \
78 cmp $$codec.out $(srcdir)/$$codec.ref; \
79 ./bincode -d -fignjunk -f$$flags -o$$codec.out $$codec \
80 $(srcdir)/$$codec.ref; \
81 cmp $$codec.out $(srcdir)/$$codec.in; \
82 echo "$$codec OK"; \
83 done
18c831dc
MW
84
85###----- That's all, folks --------------------------------------------------