]> eyrie.org Git - kerberos/krb5-strength.git/blob - Makefile.am
Merge tag 'upstream/1.1' into debian
[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
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                \
12         external/heimdal-strength.pod patches/README patches/mit-krb5-1.4.4 \
13         tests/HOWTO tests/TESTS tests/data/wordlist                         \
14         tests/heimdal/external-t tests/heimdal/plugin-t                     \
15         tests/heimdal/pod-spelling-t tests/heimdal/pod-t tests/mit/plugin-t \
16         tests/tap/libtap.sh
17
18 # Do this globally.  Everything needs to find the Kerberos headers and
19 # libraries, and if we're using the system CrackLib, add its location
20 # unconditionally as well.
21 AM_CPPFLAGS = $(CRACKLIB_CPPFLAGS) $(KRB5_CPPFLAGS)
22 AM_LDFLAGS = $(CRACKLIB_LDFLAGS) $(KRB5_LDFLAGS)
23
24 # Put the module into /usr/local/lib/kadmind by default, relative to --libdir.
25 moduledir = $(libdir)/kadmind
26
27 # Build our portability library.
28 noinst_LTLIBRARIES = portable/libportable.la
29 portable_libportable_la_SOURCES = portable/dummy.c portable/macros.h \
30         portable/stdbool.h portable/system.h
31 portable_libportable_la_LIBADD = $(LTLIBOBJS)
32
33 # If we're building with the embedded cracklib, build cracklib as a helper
34 # library and build (but don't install) the packer program.
35 cracklib_libcracklib_la_SOURCES = cracklib/fascist.c cracklib/packlib.c \
36         cracklib/rules.c cracklib/stringlib.c
37 cracklib_libcracklib_la_CPPFLAGS = -DIN_CRACKLIB
38 cracklib_packer_SOURCES = cracklib/packer.c cracklib/packer.h
39 cracklib_packer_LDADD = cracklib/libcracklib.la
40 if EMBEDDED_CRACKLIB
41     noinst_LTLIBRARIES += cracklib/libcracklib.la
42 endif
43
44 # Rules for building the password strength plugin.
45 module_LTLIBRARIES = plugin/passwd_strength.la
46 plugin_passwd_strength_la_SOURCES = plugin/api.c plugin/heimdal.c plugin/mit.c
47 plugin_passwd_strength_la_LDFLAGS = -module -avoid-version
48 if EMBEDDED_CRACKLIB
49     plugin_passwd_strength_la_LIBADD = cracklib/libcracklib.la
50 else
51     plugin_passwd_strength_la_LIBADD = $(CRACKLIB_LIBS)
52 endif
53 plugin_passwd_strength_la_LIBADD += portable/libportable.la $(KRB5_LIBS)
54
55 # The Heimdal external-check program.
56 bin_PROGRAMS = external/heimdal-strength
57 external_heimdal_strength_CFLAGS = $(AM_CFLAGS)
58 external_heimdal_strength_SOURCES = plugin/api.c plugin/api.h \
59         external/heimdal-strength.c
60 if EMBEDDED_CRACKLIB
61     external_heimdal_strength_LDADD = cracklib/libcracklib.la
62 else
63     external_heimdal_strength_LDADD = $(CRACKLIB_LIBS)
64 endif
65 external_heimdal_strength_LDADD += portable/libportable.la $(KRB5_LIBS)
66 dist_man_MANS = external/heimdal-strength.1
67
68 # Handle the standard stuff that make maintainer-clean should probably remove
69 # but doesn't.  This breaks the GNU coding standard, but in this area the GNU
70 # coding standard is dumb.
71 CLEANFILES = tests/data/dictionary.hwm tests/data/dictionary.pwd \
72         tests/data/dictionary.pwi
73 DISTCLEANFILES = tests/data/.placeholder
74 MAINTAINERCLEANFILES = Makefile.in aclocal.m4 build-aux/compile          \
75         build-aux/config.guess build-aux/config.sub build-aux/depcomp    \
76         build-aux/install-sh build-aux/ltmain.sh build-aux/missing       \
77         config.h.in config.h.in~ configure m4/libtool.m4 m4/ltoptions.m4 \
78         m4/ltsugar.m4 m4/ltversion.m4 m4/lt~obsolete.m4
79
80 # A set of flags for warnings.  Add -O because gcc won't find some warnings
81 # without optimization turned on.  Desirable warnings that can't be turned
82 # on due to other problems:
83 #
84 #     -Wconversion      http://bugs.debian.org/488884 (htons warnings)
85 #
86 # Last checked against gcc 4.6.1 (2011-05-04).  -D_FORTIFY_SOURCE=2 enables
87 # warn_unused_result attribute markings on glibc functions on Linux, which
88 # catches a few more issues.
89 WARNINGS = -g -O -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wendif-labels           \
90         -Wformat=2 -Winit-self -Wswitch-enum -Wdeclaration-after-statement  \
91         -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align           \
92         -Wwrite-strings -Wjump-misses-init -Wlogical-op                     \
93         -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls          \
94         -Wnested-externs -Werror
95
96 warnings:
97         $(MAKE) V=0 CFLAGS='$(WARNINGS)'
98         $(MAKE) V=0 CFLAGS='$(WARNINGS)' $(check_PROGRAMS)
99
100 # The bits below are for the test suite, not for the main package.
101 check_PROGRAMS = tests/heimdal/plugin tests/mit/plugin                   \
102         tests/portable/asprintf-t tests/portable/snprintf-t              \
103         tests/portable/strlcat-t tests/portable/strlcpy-t tests/runtests
104 if EMBEDDED_CRACKLIB
105     check_PROGRAMS += cracklib/packer
106 endif
107 tests_runtests_CPPFLAGS = -DSOURCE='"$(abs_top_srcdir)/tests"' \
108         -DBUILD='"$(abs_top_builddir)/tests"'
109 check_LIBRARIES = tests/tap/libtap.a
110 tests_tap_libtap_a_CPPFLAGS = -I$(abs_top_srcdir)/tests
111 tests_tap_libtap_a_SOURCES = tests/tap/basic.c tests/tap/basic.h \
112         tests/tap/macros.h
113
114 tests_heimdal_plugin_SOURCES = tests/heimdal/plugin.c
115 tests_heimdal_plugin_LDADD = portable/libportable.la $(KRB5_LIBS) $(DL_LIBS)
116 tests_mit_plugin_SOURCES = tests/mit/plugin.c
117 tests_mit_plugin_LDADD = portable/libportable.la $(KRB5_LIBS) $(DL_LIBS)
118 tests_portable_asprintf_t_SOURCES = tests/portable/asprintf-t.c \
119         tests/portable/asprintf.c
120 tests_portable_asprintf_t_LDADD = tests/tap/libtap.a portable/libportable.la
121 tests_portable_snprintf_t_SOURCES = tests/portable/snprintf-t.c \
122         tests/portable/snprintf.c
123 tests_portable_snprintf_t_LDADD = tests/tap/libtap.a portable/libportable.la
124 tests_portable_strlcat_t_SOURCES = tests/portable/strlcat-t.c \
125         tests/portable/strlcat.c
126 tests_portable_strlcat_t_LDADD = tests/tap/libtap.a portable/libportable.la
127 tests_portable_strlcpy_t_SOURCES = tests/portable/strlcpy-t.c \
128         tests/portable/strlcpy.c
129 tests_portable_strlcpy_t_LDADD = tests/tap/libtap.a portable/libportable.la
130
131 tests/data/dictionary.pwd: cracklib/packer $(srcdir)/tests/data/wordlist
132         cracklib/packer tests/data/dictionary < $(srcdir)/tests/data/wordlist
133
134 check-local: $(check_PROGRAMS) tests/data/dictionary.pwd
135         cd tests && ./runtests $(abs_top_srcdir)/tests/TESTS