]> eyrie.org Git - kerberos/krb5-strength.git/blob - Makefile.am
Update EXTRA_DIST for file changes
[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, 2010, 2012, 2013
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/wordlist tests/docs/pod-spelling-t \
15         tests/docs/pod-t tests/perl/critic-t tests/perl/minimum-version-t   \
16         tests/perl/strict-t tests/tap/libtap.sh tests/tap/perl/Test/RRA.pm  \
17         tests/tap/perl/Test/RRA/Config.pm                                   \
18         tests/tap/perl/Test/RRA/Automake.pm tests/tools/cdbmake-wordlist    \
19         tests/tools/heimdal-strength-t tools/heimdal-strength.pod
20
21 # Do this globally.  Everything needs to find the Kerberos headers and
22 # libraries, and if we're using the system CrackLib or libcdb, add its
23 # location unconditionally as well.
24 AM_CPPFLAGS = $(CRACKLIB_CPPFLAGS) $(KRB5_CPPFLAGS) $(CDB_CPPFLAGS)
25 AM_LDFLAGS = $(CRACKLIB_LDFLAGS) $(KRB5_LDFLAGS) $(CDB_LDFLAGS)
26
27 # Put the module into /usr/local/lib/kadmind by default, relative to --libdir.
28 moduledir = $(libdir)/kadmind
29
30 # Build our portability library.
31 noinst_LTLIBRARIES = portable/libportable.la
32 portable_libportable_la_SOURCES = portable/dummy.c portable/kadmin.h    \
33         portable/krb5.h portable/macros.h portable/stdbool.h            \
34         portable/system.h
35 portable_libportable_la_LIBADD = $(LTLIBOBJS)
36
37 # Build our command-line utility library.
38 noinst_LIBRARIES = util/libutil.a
39 util_libutil_a_SOURCES = util/macros.h util/messages-krb5.c                 \
40         util/messages-krb5.h util/messages.c util/messages.h util/xmalloc.c \
41         util/xmalloc.h
42
43 # If we're building with the embedded cracklib, build cracklib as a helper
44 # library and build (but don't install) the packer program.
45 cracklib_libcracklib_la_SOURCES = cracklib/fascist.c cracklib/packlib.c \
46         cracklib/rules.c cracklib/stringlib.c
47 cracklib_libcracklib_la_CPPFLAGS = -DIN_CRACKLIB
48 cracklib_packer_SOURCES = cracklib/packer.c cracklib/packer.h
49 cracklib_packer_LDADD = cracklib/libcracklib.la
50 if EMBEDDED_CRACKLIB
51     noinst_LTLIBRARIES += cracklib/libcracklib.la
52 endif
53
54 # Rules for building the password strength plugin.
55 module_LTLIBRARIES = plugin/passwd_strength.la
56 plugin_passwd_strength_la_SOURCES = plugin/api.c plugin/cdb.c \
57         plugin/heimdal.c plugin/internal.h plugin/mit.c
58 plugin_passwd_strength_la_LDFLAGS = -module -avoid-version
59 if EMBEDDED_CRACKLIB
60     plugin_passwd_strength_la_LIBADD = cracklib/libcracklib.la
61 else
62     plugin_passwd_strength_la_LIBADD = $(CRACKLIB_LIBS)
63 endif
64 plugin_passwd_strength_la_LIBADD += portable/libportable.la $(KRB5_LIBS) \
65         $(CDB_LIBS)
66
67 # The Heimdal external check program.
68 bin_PROGRAMS = tools/heimdal-strength
69 tools_heimdal_strength_CFLAGS = $(AM_CFLAGS)
70 tools_heimdal_strength_SOURCES = plugin/api.c plugin/cdb.c \
71         plugin/internal.h tools/heimdal-strength.c
72 if EMBEDDED_CRACKLIB
73     tools_heimdal_strength_LDADD = cracklib/libcracklib.la
74 else
75     tools_heimdal_strength_LDADD = $(CRACKLIB_LIBS)
76 endif
77 tools_heimdal_strength_LDADD += util/libutil.a portable/libportable.la \
78         $(KRB5_LIBS) $(CDB_LIBS)
79
80 # Other tools.
81 dist_bin_SCRIPTS = tools/cdbmake-wordlist
82
83 # Man pages for all tools.
84 dist_man_MANS = tools/heimdal-strength.1 tools/cdbmake-wordlist.1
85
86 # Handle the standard stuff that make maintainer-clean should probably remove
87 # but doesn't.  This breaks the GNU coding standard, but in this area the GNU
88 # coding standard is dumb.
89 CLEANFILES = tests/data/dictionary.hwm tests/data/dictionary.pwd \
90         tests/data/dictionary.pwi
91 DISTCLEANFILES = tests/data/.placeholder
92 MAINTAINERCLEANFILES = Makefile.in aclocal.m4 build-aux/compile          \
93         build-aux/config.guess build-aux/config.sub build-aux/depcomp    \
94         build-aux/install-sh build-aux/ltmain.sh build-aux/missing       \
95         config.h.in config.h.in~ configure m4/libtool.m4 m4/ltoptions.m4 \
96         m4/ltsugar.m4 m4/ltversion.m4 m4/lt~obsolete.m4
97
98 # A set of flags for warnings.  Add -O because gcc won't find some warnings
99 # without optimization turned on.  Desirable warnings that can't be turned
100 # on due to other problems:
101 #
102 #     -Wconversion      http://bugs.debian.org/488884 (htons warnings)
103 #
104 # Last checked against gcc 4.7.2 (2013-04-22).  -D_FORTIFY_SOURCE=2 enables
105 # warn_unused_result attribute markings on glibc functions on Linux, which
106 # catches a few more issues.
107 WARNINGS = -g -O -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wendif-labels          \
108         -Wformat=2 -Winit-self -Wswitch-enum -Wuninitialized -Wfloat-equal \
109         -Wdeclaration-after-statement -Wshadow -Wpointer-arith             \
110         -Wbad-function-cast -Wcast-align -Wwrite-strings                   \
111         -Wjump-misses-init -Wlogical-op -Wstrict-prototypes                \
112         -Wold-style-definition -Wmissing-prototypes -Wnormalized=nfc       \
113         -Wpacked -Wredundant-decls -Wnested-externs -Winline -Wvla -Werror
114
115 warnings:
116         $(MAKE) V=0 CFLAGS='$(WARNINGS)'
117         $(MAKE) V=0 CFLAGS='$(WARNINGS)' $(check_PROGRAMS)
118
119 # The bits below are for the test suite, not for the main package.
120 check_PROGRAMS = tests/heimdal/plugin-t tests/mit/plugin-t                  \
121         tests/portable/asprintf-t tests/portable/snprintf-t                 \
122         tests/portable/strlcat-t tests/portable/strlcpy-t tests/runtests    \
123         tests/util/messages-krb5-t tests/util/messages-t tests/util/xmalloc
124 if EMBEDDED_CRACKLIB
125     check_PROGRAMS += cracklib/packer
126 endif
127 tests_runtests_CPPFLAGS = -DSOURCE='"$(abs_top_srcdir)/tests"' \
128         -DBUILD='"$(abs_top_builddir)/tests"'
129 check_LIBRARIES = tests/tap/libtap.a
130 tests_tap_libtap_a_CPPFLAGS = -I$(abs_top_srcdir)/tests $(KRB5_CPPFLAGS)
131 tests_tap_libtap_a_SOURCES = tests/tap/basic.c tests/tap/basic.h        \
132         tests/tap/kerberos.c tests/tap/kerberos.h tests/tap/macros.h    \
133         tests/tap/process.c tests/tap/process.h tests/tap/string.c      \
134         tests/tap/string.h
135
136 # The actual test programs.
137 tests_heimdal_plugin_t_CPPFLAGS = $(KRB5_CPPFLAGS)
138 tests_heimdal_plugin_t_LDADD = tests/tap/libtap.a portable/libportable.la \
139         $(KRB5_LIBS) $(CDB_LIBS) $(DL_LIBS)
140 tests_mit_plugin_t_CPPFLAGS = $(KRB5_CPPFLAGS)
141 tests_mit_plugin_t_LDADD = tests/tap/libtap.a portable/libportable.la \
142         $(KRB5_LIBS) $(CDB_LIBS) $(DL_LIBS)
143 tests_portable_asprintf_t_SOURCES = tests/portable/asprintf-t.c \
144         tests/portable/asprintf.c
145 tests_portable_asprintf_t_LDADD = tests/tap/libtap.a portable/libportable.la
146 tests_portable_snprintf_t_SOURCES = tests/portable/snprintf-t.c \
147         tests/portable/snprintf.c
148 tests_portable_snprintf_t_LDADD = tests/tap/libtap.a portable/libportable.la
149 tests_portable_strlcat_t_SOURCES = tests/portable/strlcat-t.c \
150         tests/portable/strlcat.c
151 tests_portable_strlcat_t_LDADD = tests/tap/libtap.a portable/libportable.la
152 tests_portable_strlcpy_t_SOURCES = tests/portable/strlcpy-t.c \
153         tests/portable/strlcpy.c
154 tests_portable_strlcpy_t_LDADD = tests/tap/libtap.a portable/libportable.la
155 tests_util_messages_t_LDADD = tests/tap/libtap.a util/libutil.a \
156         portable/libportable.la
157 tests_util_messages_krb5_t_LDADD = tests/tap/libtap.a util/libutil.a \
158         portable/libportable.la $(KRB5_LIBS)
159 tests_util_xmalloc_LDADD = util/libutil.a portable/libportable.la
160
161 # The dictionary is used by the tests and needs to be built first.
162 if EMBEDDED_CRACKLIB
163 tests/data/dictionary.pwd: cracklib/packer $(srcdir)/cracklib/mkdict \
164                 $(srcdir)/tests/data/wordlist
165         mkdir -p tests/data
166         $(srcdir)/cracklib/mkdict $(srcdir)/tests/data/wordlist \
167             | cracklib/packer tests/data/dictionary
168 else
169 tests/data/dictionary.pwd: $(srcdir)/tests/data/wordlist
170         mkdir -p tests/data
171         cracklib-format $(srcdir)/tests/data/wordlist \
172             | cracklib-packer tests/data/dictionary
173 endif
174
175 check-local: $(check_PROGRAMS) tests/data/dictionary.pwd
176         cd tests && ./runtests -l $(abs_top_srcdir)/tests/TESTS