1 # Makefile for fetchmail
4 AUTOMAKE_OPTIONS= 1.11 foreign no-dist-gzip dist-xz color-tests
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 CFLAGS += @libpwmd_CFLAGS@
21 LDFLAGS += @libpwmd_LIBS@
24 nodist_bin_SCRIPTS= fetchmailconf
26 dist_man1_MANS+= $(pym)
28 CLEANFILES= $(nodist_bin_SCRIPTS)
30 # for gettext (used by fetchmail.c, NOT by GNU gettext)
31 localedir= $(datadir)/locale
32 DEFS= @DEFS@ -DLOCALEDIR=\"$(localedir)\"
34 noinst_LIBRARIES= libfm.a
35 libfm_a_SOURCES= xmalloc.c base64.c rfc822.c report.c rfc2047e.c \
36 servport.c ntlm.h smbbyteorder.h smbdes.h smbmd4.h \
37 smbencrypt.h smbdes.c smbencrypt.c smbmd4.c smbutil.c \
38 libesmtp/gethostbyname.h libesmtp/gethostbyname.c \
39 smbtypes.h fm_getaddrinfo.c tls.c rfc822valid.c \
40 xmalloc.h sdump.h sdump.c x509_name_match.c \
43 libfm_a_SOURCES += ntlmsubr.c
45 libfm_a_LIBADD= $(EXTRAOBJ)
46 libfm_a_DEPENDENCIES= $(EXTRAOBJ)
47 LDADD = libfm.a @LIBINTL@ $(LIBOBJS)
48 DEPENDENCIES= libfm.a $(LIBOBJS)
52 TESTS= t.smoke t.validate-xhtml10 t.validate-xhtml t.x509_name_match
53 TESTS_ENVIRONMENT= srcdir="$(srcdir)" LC_ALL=C TZ=UTC SHELL="$(SHELL)" $(SHELL)
55 fetchmail_SOURCES= fetchmail.h getopt.h \
56 gettext.h kerberos.h fm_md5.h netrc.h smtp.h \
59 fetchmail.c env.c idle.c options.c daemon.c \
60 driver.c transact.c sink.c smtp.c \
61 idlist.c uid.c md5ify.c cram.c gssapi.c \
62 opie.c interface.c netrc.c \
63 unmime.c conf.c checkalias.c uid_db.h uid_db.c\
65 rcfile_l.l rcfile_y.y \
66 ucs/norm_charmap.c ucs/norm_charmap.h
68 fetchmail_SOURCES += pop3.c
71 fetchmail_SOURCES += imap.c
74 fetchmail_SOURCES += etrn.c
77 fetchmail_SOURCES += odmr.c
80 fetchmail_SOURCES += rpa.c
83 fetchmail_SOURCES += KAME/getnameinfo.c
86 fetchmail_SOURCES += libesmtp/getaddrinfo.h libesmtp/getaddrinfo.c
89 check_PROGRAMS += rfc822 unmime netrc rfc2047e rfc822valid \
92 rfc2047e_CFLAGS= -DTEST
94 rfc822valid_CFLAGS= -DTEST
98 x509_name_match_CFLAGS= -DTEST
100 unmime_SOURCES= unmime.c
101 unmime_CFLAGS= -DSTANDALONE -DHAVE_CONFIG_H -I$(builddir)
103 netrc_SOURCES= netrc.c xmalloc.c report.c
104 netrc_CFLAGS= -DSTANDALONE -DHAVE_CONFIG_H -I$(builddir)
108 fetchmail.spec: Makefile.in specgen.sh
109 $(srcdir)/specgen.sh $(VERSION) >fetchmail.spec
111 DISTDOCS= FAQ FEATURES NOTES OLDNEWS fetchmail-man.html \
112 design-notes.html esrs-design-notes.html todo.html \
113 fetchmail-features.html README.SSL README.NTLM \
114 README.packaging README.SSL-SERVER \
115 fetchmail-FAQ.book fetchmail-FAQ.pdf fetchmail-FAQ.html \
116 Mailbox-Names-UTF7.txt Mailbox-Names-UTF7.html \
117 fetchmail-SA-2012-02.txt \
118 fetchmail-SA-2012-01.txt \
119 fetchmail-SA-2011-01.txt \
120 fetchmail-EN-2010-03.txt \
121 fetchmail-SA-2010-02.txt \
122 fetchmail-SA-2010-01.txt \
123 fetchmail-SA-2009-01.txt \
124 fetchmail-SA-2008-01.txt \
125 fetchmail-SA-2007-02.txt \
126 fetchmail-SA-2007-01.txt \
127 fetchmail-SA-2006-03.txt \
128 fetchmail-SA-2006-02.txt \
129 fetchmail-SA-2006-01.txt \
130 fetchmail-SA-2005-01.txt \
131 fetchmail-SA-2005-02.txt \
132 fetchmail-SA-2005-03.txt
134 # extra directories to ship
135 distdirs = rh-config contrib beos
137 EXTRA_DIST= $(DISTDOCS) $(distdirs) \
138 fetchmail.spec fetchmail.xpm \
139 strlcpy.3 bighand.png \
169 m4-local/ac-archive-license.txt \
170 m4-local/ac_ma_search_package.m4 \
171 $(TESTS) t.rc t.regression \
172 dist-tools/html2txt \
173 dist-tools/manServer.pl \
177 ( echo '#! /bin/sh' && echo 'exec @PYTHON@ @pythondir@/fetchmailconf.py "$$@"' ) >$@ && chmod +x $@ || { rm -f $@ ; exit 1; }
179 FAQ: fetchmail-FAQ.html $(srcdir)/dist-tools/html2txt
180 AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/fetchmail-FAQ.html >$@ || { rm -f $@ ; exit 1 ; }
182 fetchmail-FAQ.pdf: fetchmail-FAQ.html fetchmail-FAQ.book bighand.png
183 $(AWK) '/^[ \t]*<h1/ {sec++; } {if (sec < 2 || sec > 3) print $0;}' <$(srcdir)/fetchmail-FAQ.html >fetchmail-FAQ-print.html
184 htmldoc --logoimage $(srcdir)/bighand.png --batch $(srcdir)/fetchmail-FAQ.book || { rm -f $@ ; exit 1 ; }
185 rm -f fetchmail-FAQ-print.html
187 FEATURES: fetchmail-features.html $(srcdir)/dist-tools/html2txt
188 AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/fetchmail-features.html >$@ || { rm -f $@ ; exit 1 ; }
190 NOTES: design-notes.html esrs-design-notes.html $(srcdir)/dist-tools/html2txt
191 echo "This file contains two articles reformatted from HTML." > $@ \
192 && echo "------------------------------------------------------" >> $@ \
194 && AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/design-notes.html >>$@ \
195 && AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/esrs-design-notes.html >>$@ \
196 || { rm -f $@ ; exit 1 ; }
198 TODO: todo.html $(srcdir)/dist-tools/html2txt
199 AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/todo.html >$@ || { rm -f $@ ; exit 1 ; }
201 fetchmail-man.html: fetchmail.man $(srcdir)/dist-tools/manServer.pl
202 env - "PATH=$$PATH" perl -T $(srcdir)/dist-tools/manServer.pl $(srcdir)/fetchmail.man >$@ \
203 || { rm -f $@ ; exit 1 ; }
206 cd $(distdir) && find $(distdirs) po -name .git -type d -prune -exec rm -rf '{}' ';'
207 cd $(distdir) && find $(distdirs) po -name '*~' -exec rm -f '{}' ';'
211 $(SHELL) genlsm.sh >$(PACKAGE)-$(VERSION).lsm
213 # this target expects a .rsyncs file with lines of this format:
215 # it will call rsync from its source directory to the destination for
216 # each of them, running them in parallel
217 rsync: distdir $(srcdir)/.rsyncs
218 @( cat $(srcdir)/.rsyncs | sed -e 's}^}rsync -aH --delete-after $(PACKAGE)-$(VERSION)/ }; s/\($$\)/ \&/;' ; echo "wait" ) | $(SHELL) -x
220 .PHONY: import-translations
222 rsync -Lrtvz translationproject.org::tp/latest/fetchmail/ $(top_srcdir)/po
223 cd $(top_builddir)/po && $(MAKE) update-po
225 SUFFIXES = .html .txt
227 asciidoc --unsafe -a toc -a data-uri -o $@ $< || { rm -f $@ ; exit 1 ; }
229 # The following sets edit modes for GNU EMACS.
231 # compile-command:"configure"