1 # Makefile for fetchmail
4 AUTOMAKE_OPTIONS= 1.8 foreign no-dist-gzip dist-bzip2
6 AM_CPPFLAGS= -I$(srcdir)/libesmtp
7 ACLOCAL_AMFLAGS= -I m4 -I m4-local
9 BUILT_SOURCES= rcfile_y.h
11 bin_PROGRAMS= fetchmail
13 dist_noinst_SCRIPTS= specgen.sh
14 dist_man1_MANS= fetchmail.man
17 pym= fetchmailconf.man
20 nodist_bin_SCRIPTS= fetchmailconf
22 dist_man1_MANS+= $(pym)
29 CLEANFILES= $(nodist_bin_SCRIPTS)
31 # for gettext (used by fetchmail.c, NOT by GNU gettext)
32 localedir= $(datadir)/locale
33 DEFS= @DEFS@ -DLOCALEDIR=\"$(localedir)\"
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 x509_name_match.c \
43 libfm_a_LIBADD= $(EXTRAOBJ)
44 libfm_a_DEPENDENCIES= $(EXTRAOBJ)
45 LDADD = libfm.a @LIBINTL@ $(LIBOBJS)
46 DEPENDENCIES= libfm.a $(LIBOBJS)
50 TESTS= t.smoke t.validate-xhtml t.x509_name_match
51 TESTS_ENVIRONMENT= srcdir="$(srcdir)" LC_ALL=C TZ=UTC SHELL="$(SHELL)" $(SHELL)
54 noinst_LIBRARIES+= libtrio.a
55 libtrio_a_SOURCES= trio/triostr.c trio/trio.c trio/trionan.c \
56 trio/trio.h trio/triop.h trio/triodef.h \
57 trio/trionan.h trio/triostr.h
58 check_PROGRAMS+= regression
59 regression_SOURCES= trio/regression.c
64 fetchmail_SOURCES= fetchmail.h getopt.h \
65 i18n.h kerberos.h fm_md5.h mx.h netrc.h smtp.h \
68 fetchmail.c env.c idle.c options.c daemon.c \
69 driver.c transact.c sink.c smtp.c \
70 idlist.c uid.c mxget.c md5ify.c cram.c gssapi.c \
71 opie.c interface.c netrc.c \
72 unmime.c conf.c checkalias.c \
74 rcfile_l.l rcfile_y.y \
75 ucs/norm_charmap.c ucs/norm_charmap.h
77 fetchmail_SOURCES += pop2.c
80 fetchmail_SOURCES += pop3.c
83 fetchmail_SOURCES += imap.c
86 fetchmail_SOURCES += etrn.c
89 fetchmail_SOURCES += odmr.c
92 fetchmail_SOURCES += kerberos.c
95 fetchmail_SOURCES += rpa.c
98 fetchmail_SOURCES += KAME/getnameinfo.c
101 fetchmail_SOURCES += libesmtp/getaddrinfo.h libesmtp/getaddrinfo.c
104 check_PROGRAMS += rfc822 unmime netrc rfc2047e mxget rfc822valid \
107 rfc2047e_CFLAGS= -DTEST
109 rfc822valid_CFLAGS= -DTEST
111 rfc822_CFLAGS= -DMAIN
113 x509_name_match_CFLAGS= -DTEST
115 unmime_SOURCES= unmime.c
116 unmime_CFLAGS= -DSTANDALONE -DHAVE_CONFIG_H -I$(builddir)
118 netrc_SOURCES= netrc.c xmalloc.c report.c
119 netrc_CFLAGS= -DSTANDALONE -DHAVE_CONFIG_H -I$(builddir)
121 mxget_SOURCES= mxget.c
122 mxget_CFLAGS= -DSTANDALONE -DHAVE_CONFIG_H -I$(builddir)
126 fetchmail.spec: Makefile.in specgen.sh
127 $(srcdir)/specgen.sh $(VERSION) >fetchmail.spec
129 DISTDOCS= FAQ FEATURES NOTES OLDNEWS fetchmail-man.html \
130 design-notes.html esrs-design-notes.html todo.html \
131 fetchmail-features.html README.SSL README.NTLM \
132 README.packaging README.SSL-SERVER \
133 fetchmail-FAQ.book fetchmail-FAQ.pdf fetchmail-FAQ.html \
134 Mailbox-Names-UTF7.txt Mailbox-Names-UTF7.html \
135 fetchmail-SA-2010-02.txt \
136 fetchmail-SA-2010-01.txt \
137 fetchmail-SA-2009-01.txt \
138 fetchmail-SA-2008-01.txt \
139 fetchmail-SA-2007-02.txt \
140 fetchmail-SA-2007-01.txt \
141 fetchmail-SA-2006-03.txt \
142 fetchmail-SA-2006-02.txt \
143 fetchmail-SA-2006-01.txt \
144 fetchmail-SA-2005-01.txt \
145 fetchmail-SA-2005-02.txt \
146 fetchmail-SA-2005-03.txt
148 # extra directories to ship
149 distdirs = rh-config contrib beos
151 EXTRA_DIST+= $(DISTDOCS) $(distdirs) \
152 fetchmail.spec fetchmail.xpm \
153 trio/CHANGES trio/README \
154 strlcpy.3 bighand.png \
183 m4-local/ac-archive-license.txt \
184 m4-local/ac_ma_search_package.m4 \
185 $(TESTS) t.rc t.regression \
186 dist-tools/html2txt \
187 dist-tools/manServer.pl \
191 ( echo '#! /bin/sh' && echo 'exec @PYTHON@ @pythondir@/fetchmailconf.py "$$@"' ) >$@ && chmod +x $@ || { rm -f $@ ; exit 1; }
193 FAQ: fetchmail-FAQ.html $(srcdir)/dist-tools/html2txt
194 AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/fetchmail-FAQ.html >$@ || { rm -f $@ ; exit 1 ; }
196 fetchmail-FAQ.pdf: fetchmail-FAQ.html fetchmail-FAQ.book bighand.png
197 $(AWK) '/^[ \t]*<h1/ {sec++; } {if (sec < 2 || sec > 3) print $0;}' <$(srcdir)/fetchmail-FAQ.html >fetchmail-FAQ-print.html
198 htmldoc --logoimage $(srcdir)/bighand.png --batch $(srcdir)/fetchmail-FAQ.book || { rm -f $@ ; exit 1 ; }
199 rm -f fetchmail-FAQ-print.html
201 FEATURES: fetchmail-features.html $(srcdir)/dist-tools/html2txt
202 AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/fetchmail-features.html >$@ || { rm -f $@ ; exit 1 ; }
204 NOTES: design-notes.html esrs-design-notes.html $(srcdir)/dist-tools/html2txt
205 echo "This file contains two articles reformatted from HTML." > $@ \
206 && echo "------------------------------------------------------" >> $@ \
208 && AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/design-notes.html >>$@ \
209 && AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/esrs-design-notes.html >>$@ \
210 || { rm -f $@ ; exit 1 ; }
212 TODO: todo.html $(srcdir)/dist-tools/html2txt
213 AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/todo.html >$@ || { rm -f $@ ; exit 1 ; }
215 fetchmail-man.html: fetchmail.man $(srcdir)/dist-tools/manServer.pl
216 env - "PATH=$$PATH" $(srcdir)/dist-tools/manServer.pl $(srcdir)/fetchmail.man >$@ \
217 || { rm -f $@ ; exit 1 ; }
220 cd $(distdir) && find $(distdirs) po -name .git -type d -prune -exec rm -rf '{}' ';'
221 cd $(distdir) && find $(distdirs) po -name '*~' -exec rm -f '{}' ';'
225 $(SHELL) genlsm.sh >$(PACKAGE)-$(VERSION).lsm
227 # this target expects a .rsyncs file with lines of this format:
229 # it will call rsync from its source directory to the destination for
230 # each of them, running them in parallel
231 rsync: distdir $(srcdir)/.rsyncs
232 @( cat $(srcdir)/.rsyncs | sed -e 's}^}rsync -aH --delete-after $(PACKAGE)-$(VERSION)/ }; s/\($$\)/ \&/;' ; echo "wait" ) | $(SHELL) -x
234 .PHONY: import-translations
236 rsync -Lrtvz translationproject.org::tp/latest/fetchmail/ $(top_srcdir)/po
237 cd $(top_builddir)/po && $(MAKE) update-po
239 SUFFIXES = .html .txt
241 asciidoc --unsafe -a toc -a data-uri -o $@ $< || { rm -f $@ ; exit 1 ; }
243 # The following sets edit modes for GNU EMACS.
245 # compile-command:"configure"