]> eyrie.org Git - kerberos/krb5-strength.git/blob - Makefile.am
Fix POD stopwords for heimdal-history
[kerberos/krb5-strength.git] / Makefile.am
1 # Automake makefile for krb5-strength.
2 #
3 # Written by Russ Allbery <eagle@eyrie.org>
4 # Copyright 2007, 2009, 2010, 2012, 2013, 2014
5 #     The Board of Trustees of the Leland Stanford Junior University
6 #
7 # See LICENSE for licensing terms.
8
9 ACLOCAL_AMFLAGS = -I m4
10 EXTRA_DIST = .gitignore LICENSE autogen cracklib/HISTORY cracklib/LICENCE  \
11         cracklib/README cracklib/genrules.pl cracklib/mkdict tests/HOWTO   \
12         tests/TESTS tests/data/krb5.conf tests/data/make-krb5-conf         \
13         tests/data/passwords tests/data/perl.conf tests/data/perlcriticrc  \
14         tests/data/perltidyrc tests/data/valgrind.supp tests/data/wordlist \
15         tests/data/wordlist.cdb tests/docs/pod-spelling-t tests/docs/pod-t \
16         tests/perl/critic-t tests/perl/minimum-version-t                   \
17         tests/perl/strict-t tests/tap/libtap.sh tests/tap/perl/Test/RRA.pm \
18         tests/tap/perl/Test/RRA/Config.pm                                  \
19         tests/tap/perl/Test/RRA/Automake.pm tests/tools/cdbmake-wordlist-t \
20         tests/tools/heimdal-strength-t tests/util/xmalloc-t                \
21         tools/heimdal-strength.pod
22
23 # Do this globally.  Everything needs to find the Kerberos headers and
24 # libraries, and if we're using the system CrackLib or libcdb, add its
25 # location unconditionally as well.
26 AM_CPPFLAGS = $(CRACKLIB_CPPFLAGS) $(KRB5_CPPFLAGS) $(CDB_CPPFLAGS)
27 AM_LDFLAGS = $(CRACKLIB_LDFLAGS) $(KRB5_LDFLAGS) $(CDB_LDFLAGS)
28
29 # Build our portability library.
30 noinst_LTLIBRARIES = portable/libportable.la
31 portable_libportable_la_SOURCES = portable/dummy.c portable/kadmin.h    \
32         portable/krb5.h portable/macros.h portable/stdbool.h            \
33         portable/system.h
34 portable_libportable_la_LIBADD = $(LTLIBOBJS)
35
36 # Build our command-line utility library.
37 noinst_LIBRARIES = util/libutil.a
38 util_libutil_a_SOURCES = util/macros.h util/messages-krb5.c                 \
39         util/messages-krb5.h util/messages.c util/messages.h util/xmalloc.c \
40         util/xmalloc.h
41
42 # If we're building with the embedded cracklib, build cracklib as a helper
43 # library and build (but don't install) the packer program.
44 cracklib_libcracklib_la_SOURCES = cracklib/fascist.c cracklib/packlib.c \
45         cracklib/rules.c cracklib/stringlib.c
46 cracklib_libcracklib_la_CPPFLAGS = -DIN_CRACKLIB
47 cracklib_packer_SOURCES = cracklib/packer.c cracklib/packer.h
48 cracklib_packer_LDADD = cracklib/libcracklib.la
49 if EMBEDDED_CRACKLIB
50     noinst_LTLIBRARIES += cracklib/libcracklib.la
51 endif
52
53 # Put the plugin into $(libdir)/krb5/plugins/pwqual by default,
54 moduledir = $(libdir)/krb5/plugins/pwqual
55
56 # Rules for building the password strength plugin.
57 module_LTLIBRARIES = plugin/strength.la
58 plugin_strength_la_SOURCES = plugin/cdb.c plugin/classes.c plugin/config.c \
59         plugin/cracklib.c plugin/error.c plugin/general.c plugin/heimdal.c \
60         plugin/internal.h plugin/mit.c plugin/principal.c plugin/vector.c
61 plugin_strength_la_LDFLAGS = -module -avoid-version
62 if EMBEDDED_CRACKLIB
63     plugin_strength_la_LIBADD = cracklib/libcracklib.la
64 else
65     plugin_strength_la_LIBADD = $(CRACKLIB_LIBS)
66 endif
67 plugin_strength_la_LIBADD += portable/libportable.la $(KRB5_LIBS) $(CDB_LIBS)
68
69 # The Heimdal external check program.
70 bin_PROGRAMS = tools/heimdal-strength
71 tools_heimdal_strength_CFLAGS = $(AM_CFLAGS)
72 tools_heimdal_strength_SOURCES = plugin/cdb.c plugin/classes.c            \
73         plugin/config.c plugin/cracklib.c plugin/error.c plugin/general.c \
74         plugin/internal.h plugin/principal.c plugin/vector.c              \
75         tools/heimdal-strength.c
76 if EMBEDDED_CRACKLIB
77     tools_heimdal_strength_LDADD = cracklib/libcracklib.la
78 else
79     tools_heimdal_strength_LDADD = $(CRACKLIB_LIBS)
80 endif
81 tools_heimdal_strength_LDADD += util/libutil.a portable/libportable.la \
82         $(KRB5_LIBS) $(CDB_LIBS)
83
84 # Other tools.
85 dist_bin_SCRIPTS = tools/cdbmake-wordlist tools/heimdal-history
86
87 # Man pages for all tools.
88 dist_man_MANS = tools/heimdal-history.1 tools/heimdal-strength.1 \
89         tools/cdbmake-wordlist.1
90
91 # Handle the standard stuff that make maintainer-clean should probably remove
92 # but doesn't.  This breaks the GNU coding standard, but in this area the GNU
93 # coding standard is dumb.
94 CLEANFILES = tests/data/dictionary.hwm tests/data/dictionary.pwd \
95         tests/data/dictionary.pwi
96 DISTCLEANFILES = tests/data/.placeholder
97 MAINTAINERCLEANFILES = Makefile.in aclocal.m4 build-aux/compile          \
98         build-aux/config.guess build-aux/config.sub build-aux/depcomp    \
99         build-aux/install-sh build-aux/ltmain.sh build-aux/missing       \
100         config.h.in config.h.in~ configure m4/libtool.m4 m4/ltoptions.m4 \
101         m4/ltsugar.m4 m4/ltversion.m4 m4/lt~obsolete.m4
102
103 # A set of flags for warnings.  Add -O because gcc won't find some warnings
104 # without optimization turned on.  Desirable warnings that can't be turned
105 # on due to other problems:
106 #
107 #     -Wconversion      http://bugs.debian.org/488884 (htons warnings)
108 #
109 # Last checked against gcc 4.7.2 (2013-04-22).  -D_FORTIFY_SOURCE=2 enables
110 # warn_unused_result attribute markings on glibc functions on Linux, which
111 # catches a few more issues.
112 WARNINGS = -g -O -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wendif-labels          \
113         -Wformat=2 -Winit-self -Wswitch-enum -Wuninitialized -Wfloat-equal \
114         -Wdeclaration-after-statement -Wshadow -Wpointer-arith             \
115         -Wbad-function-cast -Wcast-align -Wwrite-strings                   \
116         -Wjump-misses-init -Wlogical-op -Wstrict-prototypes                \
117         -Wold-style-definition -Wmissing-prototypes -Wnormalized=nfc       \
118         -Wpacked -Wredundant-decls -Wnested-externs -Winline -Wvla -Werror
119
120 warnings:
121         $(MAKE) V=0 CFLAGS='$(WARNINGS)'
122         $(MAKE) V=0 CFLAGS='$(WARNINGS)' $(check_PROGRAMS)
123
124 # The bits below are for the test suite, not for the main package.
125 check_PROGRAMS = tests/runtests tests/plugin/heimdal-t tests/plugin/mit-t \
126         tests/portable/asprintf-t tests/portable/snprintf-t               \
127         tests/portable/strndup-t tests/util/messages-krb5-t               \
128         tests/util/messages-t tests/util/xmalloc
129 if EMBEDDED_CRACKLIB
130     check_PROGRAMS += cracklib/packer
131 endif
132 tests_runtests_CPPFLAGS = -DSOURCE='"$(abs_top_srcdir)/tests"' \
133         -DBUILD='"$(abs_top_builddir)/tests"'
134 check_LIBRARIES = tests/tap/libtap.a
135 tests_tap_libtap_a_CPPFLAGS = -I$(abs_top_srcdir)/tests $(KRB5_CPPFLAGS)
136 tests_tap_libtap_a_SOURCES = tests/tap/basic.c tests/tap/basic.h        \
137         tests/tap/kerberos.c tests/tap/kerberos.h tests/tap/macros.h    \
138         tests/tap/process.c tests/tap/process.h tests/tap/string.c      \
139         tests/tap/string.h
140
141 # The actual test programs.
142 tests_plugin_heimdal_t_CPPFLAGS = $(KRB5_CPPFLAGS)
143 tests_plugin_heimdal_t_LDADD = tests/tap/libtap.a portable/libportable.la \
144         $(KRB5_LIBS) $(CDB_LIBS) $(DL_LIBS)
145 tests_plugin_mit_t_CPPFLAGS = $(KRB5_CPPFLAGS)
146 tests_plugin_mit_t_LDADD = tests/tap/libtap.a portable/libportable.la \
147         $(KRB5_LIBS) $(CDB_LIBS) $(DL_LIBS)
148 tests_portable_asprintf_t_SOURCES = tests/portable/asprintf-t.c \
149         tests/portable/asprintf.c
150 tests_portable_asprintf_t_LDADD = tests/tap/libtap.a portable/libportable.la
151 tests_portable_snprintf_t_SOURCES = tests/portable/snprintf-t.c \
152         tests/portable/snprintf.c
153 tests_portable_snprintf_t_LDADD = tests/tap/libtap.a portable/libportable.la
154 tests_portable_strndup_t_SOURCES = tests/portable/strndup-t.c \
155         tests/portable/strndup.c
156 tests_portable_strndup_t_LDADD = tests/tap/libtap.a portable/libportable.la
157 tests_util_messages_t_LDADD = tests/tap/libtap.a util/libutil.a \
158         portable/libportable.la
159 tests_util_messages_krb5_t_LDADD = tests/tap/libtap.a util/libutil.a \
160         portable/libportable.la $(KRB5_LIBS)
161 tests_util_xmalloc_LDADD = util/libutil.a portable/libportable.la
162
163 # The dictionary is used by the tests and needs to be built first.
164 if EMBEDDED_CRACKLIB
165 tests/data/dictionary.pwd: cracklib/packer $(srcdir)/cracklib/mkdict \
166                 $(srcdir)/tests/data/wordlist
167         mkdir -p tests/data
168         $(srcdir)/cracklib/mkdict $(srcdir)/tests/data/wordlist \
169             | cracklib/packer tests/data/dictionary
170 else
171 tests/data/dictionary.pwd: $(srcdir)/tests/data/wordlist
172         mkdir -p tests/data
173         cracklib-format $(srcdir)/tests/data/wordlist \
174             | cracklib-packer tests/data/dictionary
175 endif
176
177 check-local: $(check_PROGRAMS) tests/data/dictionary.pwd
178         cd tests && ./runtests -l $(abs_top_srcdir)/tests/TESTS
179
180 # Used by maintainers to run the main test suite under valgrind.  Suppress
181 # the xmalloc and pod-spelling tests because the former won't work properly
182 # under valgrind (due to increased memory usage) and the latter is pointless
183 # to run under valgrind.  Don't try to trace the test for cdbmake-wordlist,
184 # since it's pure Perl.
185 check-valgrind: $(check_PROGRAMS) tests/data/dictionary.pwd
186         rm -rf $(abs_top_builddir)/tmp-valgrind
187         mkdir $(abs_top_builddir)/tmp-valgrind
188         env RRA_MAINTAINER_TESTS= valgrind --leak-check=full    \
189             --show-reachable=yes --trace-children=yes           \
190             --log-file=$(abs_top_builddir)/tmp-valgrind/log.%p  \
191             --suppressions=tests/data/valgrind.supp             \
192             --trace-children-skip="/bin/sh,*/cat,*/diff,*/expr,*/grep,*/mkdir,*/rm,*/rmdir,*/sed,*/sleep,*/true,*/wc,*/docs/*-t,*/perl/*-t,*/data/make-krb5-conf,*/tools/cdbmake-wordlist-t" \
193             tests/runtests -l '$(abs_top_srcdir)/tests/TESTS'