]> eyrie.org Git - kerberos/krb5-strength.git/blob - Makefile.am
Add a basic portability library
[kerberos/krb5-strength.git] / Makefile.am
1 # Automake makefile for krb5-strength.
2 #
3 # Written by Russ Allbery <rra@stanford.edu>
4 # Copyright 2007, 2009 Board of Trustees, Leland Stanford Jr. University
5 #
6 # See LICENSE for licensing terms.
7
8 AUTOMAKE_OPTIONS = foreign subdir-objects
9 ACLOCAL_AMFLAGS = -I m4
10 EXTRA_DIST = autogen cracklib/HISTORY cracklib/LICENCE cracklib/README  \
11         cracklib/mkdict patches/README patches/mit-krb5-1.4.4           \
12         tests/TESTS tests/heimdal/basic-t tests/tap/libtap.sh
13
14 # Put the module into /usr/local/lib/kadmind by default, relative to --libdir.
15 moduledir = $(libdir)/kadmind
16
17 # Build cracklib as a helper library, currently unconditionally, and build
18 # (but don't install) the packer program.
19 noinst_LTLIBRARIES = cracklib/libcracklib.la portable/libportable.la
20 cracklib_libcracklib_la_SOURCES = cracklib/fascist.c cracklib/packlib.c \
21         cracklib/rules.c cracklib/stringlib.c
22 cracklib_libcracklib_la_CPPFLAGS = -DIN_CRACKLIB
23 noinst_PROGRAMS = cracklib/packer
24 cracklib_packer_SOURCES = cracklib/packer.c cracklib/packer.h
25 cracklib_packer_LDADD = cracklib/libcracklib.la
26 portable_libportable_la_SOURCES = portable/dummy.c portable/macros.h \
27         portable/stdbool.h portable/system.h
28 portable_libportable_la_LIBADD = $(LTLIBOBJS)
29
30 # Rules for building the password strength plugin.
31 module_LTLIBRARIES = plugin/passwd_strength.la
32 plugin_passwd_strength_la_SOURCES = plugin/api.c plugin/heimdal.c
33 plugin_passwd_strength_la_LDFLAGS = -module -avoid-version
34 plugin_passwd_strength_la_LIBADD = cracklib/libcracklib.la \
35         portable/libportable.la
36
37 # The Heimdal external-check program.
38 bin_PROGRAMS = plugin/heimdal-strength
39 plugin_heimdal_strength_CFLAGS = $(AM_CFLAGS)
40 plugin_heimdal_strength_SOURCES = plugin/api.c plugin/api.h \
41         plugin/heimdal-strength.c
42 plugin_heimdal_strength_LDADD = cracklib/libcracklib.la \
43         portable/libportable.la $(KRB5_LIBS)
44
45 # Handle the standard stuff that make maintainer-clean should probably remove
46 # but doesn't.  This breaks the GNU coding standard, but in this area the GNU
47 # coding standard is dumb.
48 CLEANFILES = tests/data/dictionary.hwm tests/data/dictionary.pwd \
49         tests/data/dictionary.pwi
50 DISTCLEANFILES = tests/data/.placeholder
51 MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.h.in config.h.in~ \
52         configure
53
54 # A set of flags for warnings.  Add -O because gcc won't find some warnings
55 # without optimization turned on.
56 WARNINGS = -g -O -Wall -W -Wendif-labels -Wpointer-arith \
57         -Wbad-function-cast -Wwrite-strings -Wstrict-prototypes \
58         -Wmissing-prototypes -Wnested-externs -Werror
59
60 warnings:
61         $(MAKE) V=0 CFLAGS='$(WARNINGS)'
62         $(MAKE) V=0 CFLAGS='$(WARNINGS)' $(check_PROGRAMS)
63
64 # The bits below are for the test suite, not for the main package.
65 check_PROGRAMS = tests/runtests tests/portable/asprintf-t       \
66         tests/portable/snprintf-t tests/portable/strlcat-t      \
67         tests/portable/strlcpy-t
68 tests_runtests_CPPFLAGS = -DSOURCE='"$(abs_top_srcdir)/tests"' \
69         -DBUILD='"$(abs_top_builddir)/tests"'
70 check_LIBRARIES = tests/tap/libtap.a
71 tests_tap_libtap_a_CPPFLAGS = -I$(abs_top_srcdir)/tests
72 tests_tap_libtap_a_SOURCES = tests/tap/basic.c tests/tap/basic.h
73
74 tests_portable_asprintf_t_SOURCES = tests/portable/asprintf-t.c \
75         tests/portable/asprintf.c
76 tests_portable_asprintf_t_LDADD = tests/tap/libtap.a portable/libportable.la
77 tests_portable_snprintf_t_SOURCES = tests/portable/snprintf-t.c \
78         tests/portable/snprintf.c
79 tests_portable_snprintf_t_LDADD = tests/tap/libtap.a portable/libportable.la
80 tests_portable_strlcat_t_SOURCES = tests/portable/strlcat-t.c \
81         tests/portable/strlcat.c
82 tests_portable_strlcat_t_LDADD = tests/tap/libtap.a portable/libportable.la
83 tests_portable_strlcpy_t_SOURCES = tests/portable/strlcpy-t.c \
84         tests/portable/strlcpy.c
85 tests_portable_strlcpy_t_LDADD = tests/tap/libtap.a portable/libportable.la
86
87 tests/data/dictionary.pwd: cracklib/packer $(srcdir)/tests/data/wordlist
88         cracklib/packer tests/data/dictionary < $(srcdir)/tests/data/wordlist
89
90 check-local: $(check_PROGRAMS) tests/data/dictionary.pwd
91         cd tests && ./runtests $(abs_top_srcdir)/tests/TESTS