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