]> eyrie.org Git - kerberos/krb5-strength.git/blob - Makefile.am
New upstream version 3.1
[kerberos/krb5-strength.git] / Makefile.am
1 # Automake makefile for krb5-strength.
2 #
3 # Written by Russ Allbery <eagle@eyrie.org>
4 # Copyright 2016 Russ Allbery <eagle@eyrie.org>
5 # Copyright 2007, 2009, 2010, 2012, 2013, 2014
6 #     The Board of Trustees of the Leland Stanford Junior University
7 #
8 # See LICENSE for licensing terms.
9
10 ACLOCAL_AMFLAGS = -I m4
11 EXTRA_DIST = .gitignore .travis.yml README.md LICENSE bootstrap             \
12         cracklib/HISTORY cracklib/LICENCE cracklib/README                   \
13         cracklib/genrules.pl cracklib/mkdict docs/krb5-strength.5.in        \
14         docs/krb5-strength.pod docs/metadata tests/README tests/TESTS       \
15         tests/data/krb5.conf tests/data/make-krb5-conf tests/data/passwords \
16         tests/data/perl.conf tests/data/perlcriticrc tests/data/perltidyrc  \
17         tests/data/valgrind.supp tests/data/wordlist                        \
18         tests/data/wordlist.cdb tests/data/wordlist.sqlite                  \
19         tests/docs/pod-spelling-t tests/docs/pod-t tests/docs/urls-t        \
20         tests/perl/critic-t tests/perl/minimum-version-t                    \
21         tests/perl/strict-t tests/tap/libtap.sh tests/tap/perl/Test/RRA.pm  \
22         tests/tap/perl/Test/RRA/Config.pm                                   \
23         tests/tap/perl/Test/RRA/Automake.pm tests/tools/heimdal-history-t   \
24         tests/tools/heimdal-strength-t tests/tools/wordlist-cdb-t           \
25         tests/tools/wordlist-sqlite-t tests/tools/wordlist-t                \
26         tests/util/xmalloc-t tools/heimdal-strength.pod
27
28 # Do this globally.  Everything needs to find the Kerberos headers and
29 # libraries, and if we're using the system CrackLib, TinyCDB, or SQLite, add
30 # its location unconditionally as well.
31 AM_CPPFLAGS = $(CRACKLIB_CPPFLAGS) $(KRB5_CPPFLAGS) $(CDB_CPPFLAGS) \
32         $(SQLITE_CPPFLAGS)
33 AM_LDFLAGS = $(CRACKLIB_LDFLAGS) $(KRB5_LDFLAGS) $(CDB_LDFLAGS) \
34         $(SQLITE_LDFLAGS)
35
36 # Build our portability library.
37 noinst_LTLIBRARIES = portable/libportable.la
38 portable_libportable_la_SOURCES = portable/dummy.c portable/kadmin.h    \
39         portable/krb5.h portable/macros.h portable/stdbool.h            \
40         portable/system.h
41 portable_libportable_la_LIBADD = $(LTLIBOBJS)
42
43 # Build our command-line utility library.
44 noinst_LIBRARIES = util/libutil.a
45 util_libutil_a_SOURCES = util/macros.h util/messages-krb5.c                 \
46         util/messages-krb5.h util/messages.c util/messages.h util/xmalloc.c \
47         util/xmalloc.h
48
49 # If we're building with the embedded cracklib, build cracklib as a helper
50 # library and build (but don't install) the packer program.
51 cracklib_libcracklib_la_SOURCES = cracklib/fascist.c cracklib/packlib.c \
52         cracklib/rules.c cracklib/stringlib.c
53 cracklib_libcracklib_la_CPPFLAGS = -DIN_CRACKLIB
54 cracklib_packer_SOURCES = cracklib/packer.c cracklib/packer.h
55 cracklib_packer_LDADD = cracklib/libcracklib.la
56 if EMBEDDED_CRACKLIB
57     noinst_LTLIBRARIES += cracklib/libcracklib.la
58 endif
59
60 # Put the plugin into $(libdir)/krb5/plugins/pwqual by default,
61 moduledir = $(libdir)/krb5/plugins/pwqual
62
63 # Rules for building the password strength plugin.
64 module_LTLIBRARIES = plugin/strength.la
65 plugin_strength_la_SOURCES = plugin/cdb.c plugin/classes.c plugin/config.c \
66         plugin/cracklib.c plugin/error.c plugin/general.c plugin/heimdal.c \
67         plugin/internal.h plugin/mit.c plugin/principal.c plugin/sqlite.c  \
68         plugin/vector.c
69 plugin_strength_la_LDFLAGS = -module -avoid-version
70 if EMBEDDED_CRACKLIB
71     plugin_strength_la_LIBADD = cracklib/libcracklib.la
72 else
73     plugin_strength_la_LIBADD = $(CRACKLIB_LIBS)
74 endif
75 plugin_strength_la_LIBADD += portable/libportable.la $(KRB5_LIBS) \
76         $(CDB_LIBS) $(SQLITE_LIBS)
77
78 # The Heimdal external check program.
79 bin_PROGRAMS = tools/heimdal-strength
80 tools_heimdal_strength_CFLAGS = $(AM_CFLAGS)
81 tools_heimdal_strength_SOURCES = plugin/cdb.c plugin/classes.c            \
82         plugin/config.c plugin/cracklib.c plugin/error.c plugin/general.c \
83         plugin/internal.h plugin/principal.c plugin/sqlite.c              \
84         plugin/vector.c tools/heimdal-strength.c
85 if EMBEDDED_CRACKLIB
86     tools_heimdal_strength_LDADD = cracklib/libcracklib.la
87 else
88     tools_heimdal_strength_LDADD = $(CRACKLIB_LIBS)
89 endif
90 tools_heimdal_strength_LDADD += util/libutil.a portable/libportable.la \
91         $(KRB5_LIBS) $(CDB_LIBS) $(SQLITE_LIBS)
92
93 # Other tools.
94 dist_bin_SCRIPTS = tools/heimdal-history tools/krb5-strength-wordlist
95
96 # Man pages for all tools.
97 dist_man_MANS = tools/heimdal-history.1 tools/heimdal-strength.1 \
98         tools/krb5-strength-wordlist.1
99 man_MANS = docs/krb5-strength.5
100
101 # Substitute the installation paths into the manual page.
102 docs/krb5-strength.5: $(srcdir)/docs/krb5-strength.5.in
103         [ -d docs ] || mkdir docs
104         sed -e 's%\(\\f(CI\)*\@moduledir\(\\fI\)*\@%$(moduledir)%' \
105             < $(srcdir)/docs/krb5-strength.5.in > $@
106
107 # Handle the standard stuff that make maintainer-clean should probably remove
108 # but doesn't.  This breaks the GNU coding standard, but in this area the GNU
109 # coding standard is dumb.
110 CLEANFILES = docs/krb5-strength.5 tests/data/dictionary.hwm \
111         tests/data/dictionary.pwd tests/data/dictionary.pwi
112 DISTCLEANFILES = tests/data/.placeholder
113 MAINTAINERCLEANFILES = Makefile.in aclocal.m4 build-aux/compile         \
114         build-aux/config.guess build-aux/config.sub build-aux/depcomp   \
115         build-aux/install-sh build-aux/ltmain.sh build-aux/missing      \
116         config.h.in config.h.in~ configure docs/krb5-strength.5.in      \
117         m4/libtool.m4 m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4     \
118         m4/lt~obsolete.m4 tests/data/wordlist.cdb                       \
119         tests/data/wordlist.sqlite tools/heimdal-history.1              \
120         tools/heimdal-strength.1 tools/krb5-strength-wordlist.1
121
122 # Also remove the generated *.c files from our JSON test data on
123 # maintainer-clean.
124 maintainer-clean-local:
125         rm -f tests/data/passwords/*.c
126
127 warnings:
128         $(MAKE) V=0 CFLAGS='$(WARNINGS_CFLAGS) $(AM_CFLAGS)' \
129             KRB5_CPPFLAGS='$(KRB5_CPPFLAGS_GCC)'
130         $(MAKE) V=0 CFLAGS='$(WARNINGS_CFLAGS) $(AM_CFLAGS)' \
131             KRB5_CPPFLAGS='$(KRB5_CPPFLAGS_GCC)' $(check_PROGRAMS)
132
133 # The bits below are for the test suite, not for the main package.
134 check_PROGRAMS = tests/runtests tests/plugin/heimdal-t tests/plugin/mit-t \
135         tests/portable/asprintf-t tests/portable/mkstemp-t                \
136         tests/portable/reallocarray-t tests/portable/snprintf-t           \
137         tests/portable/strndup-t tests/util/messages-krb5-t               \
138         tests/util/messages-t tests/util/xmalloc
139 if EMBEDDED_CRACKLIB
140     check_PROGRAMS += cracklib/packer
141 endif
142 tests_runtests_CPPFLAGS = -DC_TAP_SOURCE='"$(abs_top_srcdir)/tests"' \
143         -DC_TAP_BUILD='"$(abs_top_builddir)/tests"'
144 check_LIBRARIES = tests/tap/libtap.a
145 tests_tap_libtap_a_CPPFLAGS = -I$(abs_top_srcdir)/tests $(KRB5_CPPFLAGS)
146 tests_tap_libtap_a_SOURCES = tests/tap/basic.c tests/tap/basic.h        \
147         tests/tap/kerberos.c tests/tap/kerberos.h tests/tap/macros.h    \
148         tests/tap/process.c tests/tap/process.h tests/tap/string.c      \
149         tests/tap/string.h
150
151 # The actual test programs.
152 tests_plugin_heimdal_t_CPPFLAGS = $(KRB5_CPPFLAGS)
153 tests_plugin_heimdal_t_LDADD = tests/tap/libtap.a portable/libportable.la \
154         $(KRB5_LIBS) $(CDB_LIBS) $(DL_LIBS)
155 tests_plugin_mit_t_CPPFLAGS = $(KRB5_CPPFLAGS)
156 tests_plugin_mit_t_LDADD = tests/tap/libtap.a portable/libportable.la \
157         $(KRB5_LIBS) $(CDB_LIBS) $(DL_LIBS)
158 tests_portable_asprintf_t_SOURCES = tests/portable/asprintf-t.c \
159         tests/portable/asprintf.c
160 tests_portable_asprintf_t_LDADD = tests/tap/libtap.a portable/libportable.la
161 tests_portable_mkstemp_t_SOURCES = tests/portable/mkstemp-t.c \
162         tests/portable/mkstemp.c
163 tests_portable_mkstemp_t_LDADD = tests/tap/libtap.a portable/libportable.la
164 tests_portable_reallocarray_t_SOURCES = tests/portable/reallocarray-t.c \
165         tests/portable/reallocarray.c
166 tests_portable_reallocarray_t_LDADD = tests/tap/libtap.a \
167         portable/libportable.la
168 tests_portable_snprintf_t_SOURCES = tests/portable/snprintf-t.c \
169         tests/portable/snprintf.c
170 tests_portable_snprintf_t_LDADD = tests/tap/libtap.a portable/libportable.la
171 tests_portable_strndup_t_SOURCES = tests/portable/strndup-t.c \
172         tests/portable/strndup.c
173 tests_portable_strndup_t_LDADD = tests/tap/libtap.a portable/libportable.la
174 tests_util_messages_t_LDADD = tests/tap/libtap.a util/libutil.a \
175         portable/libportable.la
176 tests_util_messages_krb5_t_LDADD = tests/tap/libtap.a util/libutil.a \
177         portable/libportable.la $(KRB5_LIBS)
178 tests_util_xmalloc_LDADD = util/libutil.a portable/libportable.la
179
180 # The dictionary is used by the tests and needs to be built first.
181 if EMBEDDED_CRACKLIB
182 tests/data/dictionary.pwd: cracklib/packer $(srcdir)/cracklib/mkdict \
183                 $(srcdir)/tests/data/wordlist
184         mkdir -p tests/data
185         $(srcdir)/cracklib/mkdict $(srcdir)/tests/data/wordlist \
186             | cracklib/packer tests/data/dictionary
187 else
188 tests/data/dictionary.pwd: $(srcdir)/tests/data/wordlist
189         mkdir -p tests/data
190         cracklib-format $(srcdir)/tests/data/wordlist \
191             | cracklib-packer tests/data/dictionary
192 endif
193
194 check-local: $(check_PROGRAMS) tests/data/dictionary.pwd
195         cd tests && ./runtests -l $(abs_top_srcdir)/tests/TESTS
196
197 # Used by maintainers to run the main test suite under valgrind.  Suppress
198 # the xmalloc and pod-spelling tests because the former won't work properly
199 # under valgrind (due to increased memory usage) and the latter is pointless
200 # to run under valgrind.  Don't try to trace several of the tests that are
201 # written in Perl or shell and test Perl programs.
202 check-valgrind: $(check_PROGRAMS) tests/data/dictionary.pwd
203         rm -rf $(abs_top_builddir)/tmp-valgrind
204         mkdir $(abs_top_builddir)/tmp-valgrind
205         env RRA_MAINTAINER_TESTS= valgrind --leak-check=full            \
206             --show-reachable=yes --trace-children=yes                   \
207             --log-file=$(abs_top_builddir)/tmp-valgrind/log.%p          \
208             --suppressions=$(abs_top_srcdir)/tests/data/valgrind.supp   \
209             --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/heimdal-history-t,*/tools/wordlist*-t" \
210             tests/runtests -l '$(abs_top_srcdir)/tests/TESTS'