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