]> Pileus Git - ~andy/fetchmail/blob - Makefile.am
Generate fetchmailconf from Makefile to expand ${prefix} properly.
[~andy/fetchmail] / Makefile.am
1 # Makefile for fetchmail
2
3 SUBDIRS=                m4 po
4
5 AM_CFLAGS=              @CEFLAGS@
6 AM_CPPFLAGS=            @CPFLAGS@
7 AM_LDFLAGS=             @LDEFLAGS@
8 ACLOCAL_AMFLAGS=        -I m4 -I m4-local
9 AM_YFLAGS=              -d
10 BUILT_SOURCES=          rcfile_y.h fetchmailconf
11
12 bin_PROGRAMS=           fetchmail
13 nodist_bin_SCRIPTS=     fetchmailconf
14 python_PYTHON=          fetchmailconf.py
15 dist_noinst_SCRIPTS=    specgen.sh
16 dist_man1_MANS=         fetchmail.man fetchmailconf.man
17
18 # for gettext (used by fetchmail.c, NOT by GNU gettext)
19 localedir=              $(datadir)/locale
20 DEFS=                   @DEFS@ -DLOCALEDIR=\"$(localedir)\"
21
22 noinst_LIBRARIES=       libfm.a
23 libfm_a_SOURCES=        xmalloc.c base64.c rfc822.c report.c rfc2047e.c servport.c
24 libfm_a_LIBADD=         $(EXTRAOBJ)
25 libfm_a_DEPENDENCIES=   $(EXTRAOBJ)
26 LDADD   =               libfm.a @LIBINTL@ $(LIBOBJS)
27 DEPENDENCIES=           libfm.a $(LIBOBJS)
28
29 check_PROGRAMS=
30
31 if NEED_TRIO
32 noinst_LIBRARIES+=      libtrio.a
33 libtrio_a_SOURCES=      trio/triostr.c trio/trio.c trio/trionan.c \
34                         trio/trio.h trio/triop.h trio/triodef.h \
35                         trio/trionan.h trio/triostr.h
36 check_PROGRAMS+=        regression
37 regression_SOURCES=     trio/regression.c
38 LDADD +=                libtrio.a -lm
39 TESTS=                  regression
40 endif
41
42 fetchmail_SOURCES=      fetchmail.h getopt.h \
43                 i18n.h kerberos.h md5.h mx.h netrc.h ntlm.h \
44                 smbbyteorder.h smbdes.h smbmd4.h smbencrypt.h smtp.h \
45                 socket.h tunable.h \
46                 socket.c getpass.c pop2.c pop3.c imap.c etrn.c \
47                 odmr.c fetchmail.c env.c idle.c options.c daemon.c \
48                 driver.c transact.c sink.c smtp.c \
49                 uid.c mxget.c md5ify.c cram.c kerberos.c gssapi.c \
50                 opie.c rpa.c interface.c netrc.c \
51                 unmime.c conf.c checkalias.c smbdes.c smbencrypt.c \
52                 smbmd4.c smbutil.c lock.c \
53                 rcfile_l.l rcfile_y.y ucs/norm_charmap.c
54
55 check_PROGRAMS +=       rfc822 unmime netrc rfc2047e
56
57 rfc2047e_CFLAGS=        -DTEST
58
59 rfc822_CFLAGS=  -DMAIN
60
61 unmime_SOURCES= unmime.c
62 unmime_CFLAGS=  -DSTANDALONE -DHAVE_CONFIG_H -I$(builddir)
63
64 netrc_SOURCES=  netrc.c xmalloc.c report.c
65 netrc_CFLAGS=   -DSTANDALONE -DHAVE_CONFIG_H -I$(builddir)
66
67 # For some losing Unix makes.
68 SHELL = /bin/sh
69 @SET_MAKE@
70
71 fetchmail.spec: Makefile.in specgen.sh
72         $(srcdir)/specgen.sh $(VERSION) >fetchmail.spec
73
74 DISTDOCS=       BUGS FAQ FEATURES NOTES OLDNEWS fetchmail-man.html \
75                 fetchmail-FAQ.html design-notes.html esrs-design-notes.html todo.html \
76                 fetchmail-features.html README.SSL README.NTLM \
77                 fetchmail-SA-2005-01.txt
78
79 # extra directories to ship
80 distdirs = rh-config contrib beos
81
82 EXTRA_DIST= $(DISTDOCS) fetchmail.spec $(distdirs) ucs/README.svn \
83             trio/CHANGES trio/README strlcpy.3 \
84             m4-local/ac-archive-license.txt m4-local/ac_ma_search_package.m4
85
86 fetchmailconf:
87         ( echo '#! /bin/sh' && echo 'exec @PYTHON@ @pythondir@/fetchmailconf.py "$$@"' ) >$@ || { rm -f $@ ; exit 1; }
88
89 FAQ: fetchmail-FAQ.html
90         AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/fetchmail-FAQ.html >$@ || { rm -f $@ ; exit 1 ; }
91
92 FEATURES: fetchmail-features.html
93         AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/fetchmail-features.html >$@ || { rm -f $@ ; exit 1 ; }
94
95 NOTES: design-notes.html esrs-design-notes.html
96            echo "This file contains two articles reformatted from HTML." > $@ \
97         && echo "------------------------------------------------------" >> $@ \
98         && echo "" >> $@ \
99         && AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/design-notes.html >>$@ \
100         && AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/esrs-design-notes.html >>$@ \
101         || { rm -f $@ ; exit 1 ; }
102
103 TODO: todo.html
104         AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/todo.html >$@ || { rm -f $@ ; exit 1 ; }
105
106 fetchmail-man.html: fetchmail.man
107         env - PATH=$$PATH $(srcdir)/dist-tools/manServer.pl $(srcdir)/fetchmail.man >$@ \
108         || { rm -f $@ ; exit 1 ; }
109
110 dist-hook:
111         cd $(distdir) && find $(distdirs) po -name .svn -type d -prune -exec rm -rf '{}' ';'
112         cd $(distdir) && find $(distdirs) po -name '*~' -exec rm -f '{}' ';'
113
114 # The following sets edit modes for GNU EMACS.
115 # Local Variables:
116 # compile-command:"configure"
117 # End: