]> Pileus Git - ~andy/fetchmail/blob - Makefile.am
Correct title/topic, remove dates (6.3.22 isn't out yet), and re-sign.
[~andy/fetchmail] / Makefile.am
1 # Makefile for fetchmail
2
3 SUBDIRS=                . po
4 AUTOMAKE_OPTIONS=       1.11 foreign no-dist-gzip dist-bzip2 dist-xz
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 x509_name_match.c \
42                         fm_strl.h md5c.c
43 if NTLM_ENABLE
44 libfm_a_SOURCES += ntlmsubr.c
45 endif
46 libfm_a_LIBADD=         $(EXTRAOBJ)
47 libfm_a_DEPENDENCIES=   $(EXTRAOBJ)
48 LDADD   =               libfm.a @LIBINTL@ $(LIBOBJS)
49 DEPENDENCIES=           libfm.a $(LIBOBJS)
50
51 check_PROGRAMS=
52
53 TESTS=                  t.smoke t.validate-xhtml10 t.validate-xhtml t.x509_name_match
54 TESTS_ENVIRONMENT=      srcdir="$(srcdir)" LC_ALL=C TZ=UTC SHELL="$(SHELL)" $(SHELL)
55
56 if NEED_TRIO
57 noinst_LIBRARIES+=      libtrio.a
58 libtrio_a_SOURCES=      trio/triostr.c trio/trio.c trio/trionan.c \
59                         trio/trio.h trio/triop.h trio/triodef.h \
60                         trio/trionan.h trio/triostr.h
61 check_PROGRAMS+=        regression
62 regression_SOURCES=     trio/regression.c
63 LDADD+=                 libtrio.a -lm
64 TESTS+=                 t.regression
65 endif
66
67 fetchmail_SOURCES=      fetchmail.h getopt.h \
68                 i18n.h kerberos.h fm_md5.h mx.h netrc.h smtp.h \
69                 socket.h tunable.h \
70                 socket.c getpass.c \
71                 fetchmail.c env.c idle.c options.c daemon.c \
72                 driver.c transact.c sink.c smtp.c \
73                 idlist.c uid.c mxget.c md5ify.c cram.c gssapi.c \
74                 opie.c interface.c netrc.c \
75                 unmime.c conf.c checkalias.c \
76                 lock.h lock.c \
77                 rcfile_l.l rcfile_y.y \
78                 ucs/norm_charmap.c ucs/norm_charmap.h
79 if POP2_ENABLE
80 fetchmail_SOURCES += pop2.c
81 endif
82 if POP3_ENABLE
83 fetchmail_SOURCES += pop3.c
84 endif
85 if IMAP_ENABLE
86 fetchmail_SOURCES += imap.c
87 endif
88 if ETRN_ENABLE
89 fetchmail_SOURCES += etrn.c
90 endif
91 if ODMR_ENABLE
92 fetchmail_SOURCES += odmr.c
93 endif
94 if KERBEROS_V4_ENABLE
95 fetchmail_SOURCES += kerberos.c
96 endif
97 if RPA_ENABLE
98 fetchmail_SOURCES += rpa.c
99 endif
100 if NEED_GETNAMEINFO
101 fetchmail_SOURCES += KAME/getnameinfo.c
102 endif
103 if NEED_GETADDRINFO
104 fetchmail_SOURCES += libesmtp/getaddrinfo.h libesmtp/getaddrinfo.c
105 endif
106
107 check_PROGRAMS +=       rfc822 unmime netrc rfc2047e mxget rfc822valid \
108                         x509_name_match
109
110 rfc2047e_CFLAGS=        -DTEST
111
112 rfc822valid_CFLAGS=     -DTEST
113
114 rfc822_CFLAGS=          -DMAIN
115
116 x509_name_match_CFLAGS= -DTEST
117
118 unmime_SOURCES= unmime.c
119 unmime_CFLAGS=  -DSTANDALONE -DHAVE_CONFIG_H -I$(builddir)
120
121 netrc_SOURCES=  netrc.c xmalloc.c report.c
122 netrc_CFLAGS=   -DSTANDALONE -DHAVE_CONFIG_H -I$(builddir)
123
124 mxget_SOURCES=  mxget.c
125 mxget_CFLAGS=   -DSTANDALONE -DHAVE_CONFIG_H -I$(builddir)
126
127 @SET_MAKE@
128
129 fetchmail.spec: Makefile.in specgen.sh
130         $(srcdir)/specgen.sh $(VERSION) >fetchmail.spec
131
132 DISTDOCS=       FAQ FEATURES NOTES OLDNEWS fetchmail-man.html \
133                 design-notes.html esrs-design-notes.html todo.html \
134                 fetchmail-features.html README.SSL README.NTLM \
135                 README.packaging README.SSL-SERVER \
136                 fetchmail-FAQ.book fetchmail-FAQ.pdf fetchmail-FAQ.html \
137                 Mailbox-Names-UTF7.txt Mailbox-Names-UTF7.html \
138                 fetchmail-SA-2012-02.txt \
139                 fetchmail-SA-2012-01.txt \
140                 fetchmail-SA-2011-01.txt \
141                 fetchmail-EN-2010-03.txt \
142                 fetchmail-SA-2010-02.txt \
143                 fetchmail-SA-2010-01.txt \
144                 fetchmail-SA-2009-01.txt \
145                 fetchmail-SA-2008-01.txt \
146                 fetchmail-SA-2007-02.txt \
147                 fetchmail-SA-2007-01.txt \
148                 fetchmail-SA-2006-03.txt \
149                 fetchmail-SA-2006-02.txt \
150                 fetchmail-SA-2006-01.txt \
151                 fetchmail-SA-2005-01.txt \
152                 fetchmail-SA-2005-02.txt \
153                 fetchmail-SA-2005-03.txt
154
155 # extra directories to ship
156 distdirs = rh-config contrib beos
157
158 EXTRA_DIST+=    $(DISTDOCS) $(distdirs) \
159                 fetchmail.spec fetchmail.xpm \
160                 trio/CHANGES trio/README \
161                 strlcpy.3 bighand.png \
162                 m4/codeset.m4 \
163                 m4/gettext.m4 \
164                 m4/glibc2.m4 \
165                 m4/glibc21.m4 \
166                 m4/iconv.m4 \
167                 m4/intdiv0.m4 \
168                 m4/intl.m4 \
169                 m4/intldir.m4 \
170                 m4/intlmacosx.m4 \
171                 m4/intmax.m4 \
172                 m4/inttypes-pri.m4 \
173                 m4/inttypes_h.m4 \
174                 m4/lcmessage.m4 \
175                 m4/lib-ld.m4 \
176                 m4/lib-link.m4 \
177                 m4/lib-prefix.m4 \
178                 m4/lock.m4 \
179                 m4/longlong.m4 \
180                 m4/nls.m4 \
181                 m4/po.m4 \
182                 m4/printf-posix.m4 \
183                 m4/progtest.m4 \
184                 m4/size_max.m4 \
185                 m4/stdint_h.m4 \
186                 m4/uintmax_t.m4 \
187                 m4/visibility.m4 \
188                 m4/wchar_t.m4 \
189                 m4/wint_t.m4 \
190                 m4/xsize.m4 \
191                 m4-local/ac-archive-license.txt \
192                 m4-local/ac_ma_search_package.m4 \
193                 $(TESTS) t.rc t.regression \
194                 dist-tools/html2txt \
195                 dist-tools/manServer.pl \
196                 Doxyfile
197
198 fetchmailconf:
199         ( echo '#! /bin/sh' && echo 'exec @PYTHON@ @pythondir@/fetchmailconf.py "$$@"' ) >$@ && chmod +x $@ || { rm -f $@ ; exit 1; }
200
201 FAQ: fetchmail-FAQ.html $(srcdir)/dist-tools/html2txt
202         AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/fetchmail-FAQ.html >$@ || { rm -f $@ ; exit 1 ; }
203
204 fetchmail-FAQ.pdf: fetchmail-FAQ.html fetchmail-FAQ.book bighand.png
205         $(AWK) '/^[ \t]*<h1/ {sec++; } {if (sec < 2 || sec > 3) print $0;}' <$(srcdir)/fetchmail-FAQ.html >fetchmail-FAQ-print.html
206         htmldoc --logoimage $(srcdir)/bighand.png --batch $(srcdir)/fetchmail-FAQ.book || { rm -f $@ ; exit 1 ; }
207         rm -f fetchmail-FAQ-print.html
208
209 FEATURES: fetchmail-features.html $(srcdir)/dist-tools/html2txt
210         AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/fetchmail-features.html >$@ || { rm -f $@ ; exit 1 ; }
211
212 NOTES: design-notes.html esrs-design-notes.html $(srcdir)/dist-tools/html2txt
213            echo "This file contains two articles reformatted from HTML." > $@ \
214         && echo "------------------------------------------------------" >> $@ \
215         && echo "" >> $@ \
216         && AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/design-notes.html >>$@ \
217         && AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/esrs-design-notes.html >>$@ \
218         || { rm -f $@ ; exit 1 ; }
219
220 TODO: todo.html $(srcdir)/dist-tools/html2txt
221         AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/todo.html >$@ || { rm -f $@ ; exit 1 ; }
222
223 fetchmail-man.html: fetchmail.man $(srcdir)/dist-tools/manServer.pl
224         env - "PATH=$$PATH" perl -T $(srcdir)/dist-tools/manServer.pl $(srcdir)/fetchmail.man >$@ \
225         || { rm -f $@ ; exit 1 ; }
226
227 dist-hook:
228         cd $(distdir) && find $(distdirs) po -name .git -type d -prune -exec rm -rf '{}' ';'
229         cd $(distdir) && find $(distdirs) po -name '*~' -exec rm -f '{}' ';'
230
231 .PHONY: lsm
232 lsm: genlsm.sh dist
233         $(SHELL) genlsm.sh >$(PACKAGE)-$(VERSION).lsm
234
235 # this target expects a .rsyncs file with lines of this format:
236 # host:directory/
237 # it will call rsync from its source directory to the destination for
238 # each of them, running them in parallel
239 rsync:  distdir $(srcdir)/.rsyncs
240         @( cat $(srcdir)/.rsyncs | sed -e 's}^}rsync -aH --delete-after $(PACKAGE)-$(VERSION)/ }; s/\($$\)/ \&/;' ; echo "wait" ) | $(SHELL) -x
241
242 .PHONY: import-translations
243 import-translations:
244         rsync -Lrtvz translationproject.org::tp/latest/fetchmail/  $(top_srcdir)/po
245         cd $(top_builddir)/po && $(MAKE) update-po
246
247 SUFFIXES = .html .txt
248 .txt.html:
249         asciidoc --unsafe -a toc -a data-uri -o $@ $< || { rm -f $@ ; exit 1 ; }
250
251 # The following sets edit modes for GNU EMACS.
252 # Local Variables:
253 # compile-command:"configure"
254 # End: