]> Pileus Git - ~andy/fetchmail/blob - Makefile.am
Take care to ship a complete tarball even if PYTHON isn't installed.
[~andy/fetchmail] / Makefile.am
1 # Makefile for fetchmail
2
3 SUBDIRS=                m4 po
4 AUTOMAKE_OPTIONS=       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 libfm_a_LIBADD=         $(EXTRAOBJ)
43 libfm_a_DEPENDENCIES=   $(EXTRAOBJ)
44 LDADD   =               libfm.a @LIBINTL@ $(LIBOBJS)
45 DEPENDENCIES=           libfm.a $(LIBOBJS)
46
47 check_PROGRAMS=
48
49 if NEED_TRIO
50 noinst_LIBRARIES+=      libtrio.a
51 libtrio_a_SOURCES=      trio/triostr.c trio/trio.c trio/trionan.c \
52                         trio/trio.h trio/triop.h trio/triodef.h \
53                         trio/trionan.h trio/triostr.h
54 check_PROGRAMS+=        regression
55 regression_SOURCES=     trio/regression.c
56 LDADD +=                libtrio.a -lm
57 TESTS=                  regression
58 endif
59
60 fetchmail_SOURCES=      fetchmail.h getopt.h \
61                 i18n.h kerberos.h md5.h mx.h netrc.h smtp.h \
62                 socket.h tunable.h \
63                 socket.c getpass.c pop2.c pop3.c imap.c etrn.c \
64                 odmr.c fetchmail.c env.c idle.c options.c daemon.c \
65                 driver.c transact.c sink.c smtp.c \
66                 uid.c mxget.c md5ify.c cram.c kerberos.c gssapi.c \
67                 opie.c rpa.c interface.c netrc.c \
68                 unmime.c conf.c checkalias.c lock.c \
69                 rcfile_l.l rcfile_y.y ucs/norm_charmap.c \
70                 libesmtp/getaddrinfo.h libesmtp/getaddrinfo.c \
71                 KAME/getnameinfo.c
72
73 check_PROGRAMS +=       rfc822 unmime netrc rfc2047e mxget
74
75 rfc2047e_CFLAGS=        -DTEST
76
77 rfc822_CFLAGS=  -DMAIN
78
79 unmime_SOURCES= unmime.c
80 unmime_CFLAGS=  -DSTANDALONE -DHAVE_CONFIG_H -I$(builddir)
81
82 netrc_SOURCES=  netrc.c xmalloc.c report.c
83 netrc_CFLAGS=   -DSTANDALONE -DHAVE_CONFIG_H -I$(builddir)
84
85 mxget_SOURCES=  mxget.c
86 mxget_CFLAGS=   -DSTANDALONE -DHAVE_CONFIG_H -I$(builddir)
87
88 # For some losing Unix makes.
89 SHELL = /bin/sh
90 @SET_MAKE@
91
92 fetchmail.spec: Makefile.in specgen.sh
93         $(srcdir)/specgen.sh $(VERSION) >fetchmail.spec
94
95 DISTDOCS=       BUGS FAQ FEATURES NOTES OLDNEWS fetchmail-man.html \
96                 fetchmail-FAQ.html design-notes.html esrs-design-notes.html todo.html \
97                 fetchmail-features.html README.SSL README.NTLM \
98                 README.packaging \
99                 fetchmail-SA-2005-01.txt \
100                 fetchmail-SA-2005-02.txt
101
102 # extra directories to ship
103 distdirs = rh-config contrib beos
104
105 EXTRA_DIST+=    $(DISTDOCS) fetchmail.spec $(distdirs) ucs/README.svn \
106                 trio/CHANGES trio/README \
107                 strlcpy.3 \
108                 m4-local/ac-archive-license.txt \
109                 m4-local/ac_ma_search_package.m4
110
111 fetchmailconf:
112         ( echo '#! /bin/sh' && echo 'exec @PYTHON@ @pythondir@/fetchmailconf.py "$$@"' ) >$@ || { rm -f $@ ; exit 1; }
113
114 FAQ: fetchmail-FAQ.html
115         AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/fetchmail-FAQ.html >$@ || { rm -f $@ ; exit 1 ; }
116
117 FEATURES: fetchmail-features.html
118         AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/fetchmail-features.html >$@ || { rm -f $@ ; exit 1 ; }
119
120 NOTES: design-notes.html esrs-design-notes.html
121            echo "This file contains two articles reformatted from HTML." > $@ \
122         && echo "------------------------------------------------------" >> $@ \
123         && echo "" >> $@ \
124         && AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/design-notes.html >>$@ \
125         && AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/esrs-design-notes.html >>$@ \
126         || { rm -f $@ ; exit 1 ; }
127
128 TODO: todo.html
129         AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/todo.html >$@ || { rm -f $@ ; exit 1 ; }
130
131 fetchmail-man.html: fetchmail.man
132         env - PATH=$$PATH $(srcdir)/dist-tools/manServer.pl $(srcdir)/fetchmail.man >$@ \
133         || { rm -f $@ ; exit 1 ; }
134
135 dist-hook:
136         cd $(distdir) && find $(distdirs) po -name .svn -type d -prune -exec rm -rf '{}' ';'
137         cd $(distdir) && find $(distdirs) po -name '*~' -exec rm -f '{}' ';'
138
139 # The following sets edit modes for GNU EMACS.
140 # Local Variables:
141 # compile-command:"configure"
142 # End: