]> Pileus Git - ~andy/fetchmail/blob - Makefile.am
Security fix for sdump() (X.509 cert display in verbose mode).
[~andy/fetchmail] / Makefile.am
1 # Makefile for fetchmail
2
3 SUBDIRS=                . po
4 AUTOMAKE_OPTIONS=       1.8 foreign no-dist-gzip dist-bzip2
5
6 AM_CPPFLAGS=            -I$(srcdir)/libesmtp
7 ACLOCAL_AMFLAGS=        -I m4 -I m4-local
8 AM_YFLAGS=              -d
9 BUILT_SOURCES=          rcfile_y.h
10
11 bin_PROGRAMS=           fetchmail
12
13 dist_noinst_SCRIPTS=    specgen.sh
14 dist_man1_MANS=         fetchmail.man
15
16 pys=                    fetchmailconf.py
17 pym=                    fetchmailconf.man
18
19 if HAVE_PYTHON
20 nodist_bin_SCRIPTS=     fetchmailconf
21 python_PYTHON=          $(pys)
22 dist_man1_MANS+=        $(pym)
23 EXTRA_DIST=
24 else
25 noinst_PYTHON=          $(pys)
26 EXTRA_DIST=             $(pym)
27 endif
28
29 CLEANFILES=             $(nodist_bin_SCRIPTS)
30
31 # for gettext (used by fetchmail.c, NOT by GNU gettext)
32 localedir=              $(datadir)/locale
33 DEFS=                   @DEFS@ -DLOCALEDIR=\"$(localedir)\"
34
35 noinst_LIBRARIES=       libfm.a
36 libfm_a_SOURCES=        xmalloc.c base64.c rfc822.c report.c rfc2047e.c \
37                         servport.c ntlm.h smbbyteorder.h smbdes.h smbmd4.h \
38                         smbencrypt.h smbdes.c smbencrypt.c smbmd4.c smbutil.c \
39                         libesmtp/gethostbyname.h libesmtp/gethostbyname.c \
40                         smbtypes.h fm_getaddrinfo.c tls.c rfc822valid.c \
41                         xmalloc.h sdump.h sdump.c
42 libfm_a_LIBADD=         $(EXTRAOBJ)
43 libfm_a_DEPENDENCIES=   $(EXTRAOBJ)
44 LDADD   =               libfm.a @LIBINTL@ $(LIBOBJS)
45 DEPENDENCIES=           libfm.a $(LIBOBJS)
46
47 check_PROGRAMS=
48
49 TESTS=                  t.smoke t.validate-xhtml
50 TESTS_ENVIRONMENT=      srcdir="$(srcdir)" LC_ALL=C TZ=UTC SHELL="$(SHELL)" $(SHELL)
51
52 if NEED_TRIO
53 noinst_LIBRARIES+=      libtrio.a
54 libtrio_a_SOURCES=      trio/triostr.c trio/trio.c trio/trionan.c \
55                         trio/trio.h trio/triop.h trio/triodef.h \
56                         trio/trionan.h trio/triostr.h
57 check_PROGRAMS+=        regression
58 regression_SOURCES=     trio/regression.c
59 LDADD +=                libtrio.a -lm
60 TESTS+=                 regression
61 endif
62
63 fetchmail_SOURCES=      fetchmail.h getopt.h \
64                 i18n.h kerberos.h md5.h mx.h netrc.h smtp.h \
65                 socket.h tunable.h \
66                 socket.c getpass.c \
67                 fetchmail.c env.c idle.c options.c daemon.c \
68                 driver.c transact.c sink.c smtp.c \
69                 uid.c mxget.c md5ify.c cram.c gssapi.c \
70                 opie.c interface.c netrc.c \
71                 unmime.c conf.c checkalias.c \
72                 lock.h lock.c \
73                 rcfile_l.l rcfile_y.y ucs/norm_charmap.c
74 if POP2_ENABLE
75 fetchmail_SOURCES += pop2.c
76 endif
77 if POP3_ENABLE
78 fetchmail_SOURCES += pop3.c
79 endif
80 if IMAP_ENABLE
81 fetchmail_SOURCES += imap.c
82 endif
83 if ETRN_ENABLE
84 fetchmail_SOURCES += etrn.c
85 endif
86 if ODMR_ENABLE
87 fetchmail_SOURCES += odmr.c
88 endif
89 if KERBEROS_V4_ENABLE
90 fetchmail_SOURCES += kerberos.c
91 endif
92 if RPA_ENABLE
93 fetchmail_SOURCES += rpa.c
94 endif
95 if NEED_GETNAMEINFO
96 fetchmail_SOURCES += KAME/getnameinfo.c
97 endif
98 if NEED_GETADDRINFO
99 fetchmail_SOURCES += libesmtp/getaddrinfo.h libesmtp/getaddrinfo.c
100 endif
101
102 check_PROGRAMS +=       rfc822 unmime netrc rfc2047e mxget rfc822valid
103
104 rfc2047e_CFLAGS=        -DTEST
105
106 rfc822valid_CFLAGS=     -DTEST
107
108 rfc822_CFLAGS=          -DMAIN
109
110 unmime_SOURCES= unmime.c
111 unmime_CFLAGS=  -DSTANDALONE -DHAVE_CONFIG_H -I$(builddir)
112
113 netrc_SOURCES=  netrc.c xmalloc.c report.c
114 netrc_CFLAGS=   -DSTANDALONE -DHAVE_CONFIG_H -I$(builddir)
115
116 mxget_SOURCES=  mxget.c
117 mxget_CFLAGS=   -DSTANDALONE -DHAVE_CONFIG_H -I$(builddir)
118
119 @SET_MAKE@
120
121 fetchmail.spec: Makefile.in specgen.sh
122         $(srcdir)/specgen.sh $(VERSION) >fetchmail.spec
123
124 DISTDOCS=       FAQ FEATURES NOTES OLDNEWS fetchmail-man.html \
125                 design-notes.html esrs-design-notes.html todo.html \
126                 fetchmail-features.html README.SSL README.NTLM \
127                 README.packaging README.SSL-SERVER \
128                 fetchmail-FAQ.book fetchmail-FAQ.pdf fetchmail-FAQ.html \
129                 fetchmail-SA-2010-01.txt \
130                 fetchmail-SA-2009-01.txt \
131                 fetchmail-SA-2008-01.txt \
132                 fetchmail-SA-2007-02.txt \
133                 fetchmail-SA-2007-01.txt \
134                 fetchmail-SA-2006-03.txt \
135                 fetchmail-SA-2006-02.txt \
136                 fetchmail-SA-2006-01.txt \
137                 fetchmail-SA-2005-01.txt \
138                 fetchmail-SA-2005-02.txt \
139                 fetchmail-SA-2005-03.txt
140
141 # extra directories to ship
142 distdirs = rh-config contrib beos
143
144 EXTRA_DIST+=    $(DISTDOCS) $(distdirs) \
145                 ucs/README.svn \
146                 fetchmail.spec fetchmail.xpm \
147                 trio/CHANGES trio/README \
148                 strlcpy.3 bighand.png \
149                 m4/codeset.m4 \
150                 m4/gettext.m4 \
151                 m4/glibc21.m4 \
152                 m4/iconv.m4 \
153                 m4/intdiv0.m4 \
154                 m4/intmax.m4 \
155                 m4/inttypes-pri.m4 \
156                 m4/inttypes.m4 \
157                 m4/inttypes_h.m4 \
158                 m4/isc-posix.m4 \
159                 m4/lcmessage.m4 \
160                 m4/lib-ld.m4 \
161                 m4/lib-link.m4 \
162                 m4/lib-prefix.m4 \
163                 m4/longdouble.m4 \
164                 m4/longlong.m4 \
165                 m4/nls.m4 \
166                 m4/po.m4 \
167                 m4/printf-posix.m4 \
168                 m4/progtest.m4 \
169                 m4/signed.m4 \
170                 m4/size_max.m4 \
171                 m4/stdint_h.m4 \
172                 m4/uintmax_t.m4 \
173                 m4/ulonglong.m4 \
174                 m4/wchar_t.m4 \
175                 m4/wint_t.m4 \
176                 m4/xsize.m4 \
177                 m4-local/ac-archive-license.txt \
178                 m4-local/ac_ma_search_package.m4 \
179                 $(TESTS) t.rc \
180                 dist-tools/html2txt \
181                 dist-tools/manServer.pl \
182                 Doxyfile
183
184 fetchmailconf:
185         ( echo '#! /bin/sh' && echo 'exec @PYTHON@ @pythondir@/fetchmailconf.py "$$@"' ) >$@ && chmod +x $@ || { rm -f $@ ; exit 1; }
186
187 FAQ: fetchmail-FAQ.html $(srcdir)/dist-tools/html2txt
188         AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/fetchmail-FAQ.html >$@ || { rm -f $@ ; exit 1 ; }
189
190 fetchmail-FAQ.pdf: fetchmail-FAQ.html fetchmail-FAQ.book bighand.png
191         $(AWK) '/^[ \t]*<h1/ {sec++; } {if (sec < 2 || sec > 3) print $0;}' <$(srcdir)/fetchmail-FAQ.html >fetchmail-FAQ-print.html
192         htmldoc --logoimage $(srcdir)/bighand.png --batch $(srcdir)/fetchmail-FAQ.book || { rm -f $@ ; exit 1 ; }
193         rm -f fetchmail-FAQ-print.html
194
195 FEATURES: fetchmail-features.html $(srcdir)/dist-tools/html2txt
196         AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/fetchmail-features.html >$@ || { rm -f $@ ; exit 1 ; }
197
198 NOTES: design-notes.html esrs-design-notes.html $(srcdir)/dist-tools/html2txt
199            echo "This file contains two articles reformatted from HTML." > $@ \
200         && echo "------------------------------------------------------" >> $@ \
201         && echo "" >> $@ \
202         && AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/design-notes.html >>$@ \
203         && AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/esrs-design-notes.html >>$@ \
204         || { rm -f $@ ; exit 1 ; }
205
206 TODO: todo.html $(srcdir)/dist-tools/html2txt
207         AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/todo.html >$@ || { rm -f $@ ; exit 1 ; }
208
209 fetchmail-man.html: fetchmail.man $(srcdir)/dist-tools/manServer.pl
210         env - "PATH=$$PATH" $(srcdir)/dist-tools/manServer.pl $(srcdir)/fetchmail.man >$@ \
211         || { rm -f $@ ; exit 1 ; }
212
213 dist-hook:
214         cd $(distdir) && find $(distdirs) po -name .svn -type d -prune -exec rm -rf '{}' ';'
215         cd $(distdir) && find $(distdirs) po -name '*~' -exec rm -f '{}' ';'
216
217 .PHONY: lsm
218 lsm: genlsm.sh dist
219         $(SHELL) genlsm.sh >$(PACKAGE)-$(VERSION).lsm
220
221 # this target expects a .rsyncs file with lines of this format:
222 # host:directory/
223 # it will call rsync from its source directory to the destination for
224 # each of them, running them in parallel
225 rsync:  distdir $(srcdir)/.rsyncs
226         @( cat $(srcdir)/.rsyncs | sed -e 's}^}rsync -aH --delete-after $(PACKAGE)-$(VERSION)/ }; s/\($$\)/ \&/;' ; echo "wait" ) | $(SHELL) -x
227
228 # The following sets edit modes for GNU EMACS.
229 # Local Variables:
230 # compile-command:"configure"
231 # End: