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