Makefile.am 7.98 KB
Newer Older
1 2
# Makefile for fetchmail

Matthias Andree's avatar
Matthias Andree committed
3
SUBDIRS=		. po
4
AUTOMAKE_OPTIONS=	1.11 foreign no-dist-gzip dist-xz subdir-objects
5

6
AM_CPPFLAGS=		-I$(srcdir)/libesmtp
7
ACLOCAL_AMFLAGS=	-I m4 -I m4-local
8
AM_YFLAGS=		-d
9 10 11 12
# listing socket.$(OBJEXT) here is a hack to compile socket.c pretty
# early in order to fail it early on outdated OpenSSL libraries,
# without building a few dozen other files first.
BUILT_SOURCES=		rcfile_y.h socket.$(OBJEXT)
13 14

bin_PROGRAMS=		fetchmail
15 16 17 18

dist_noinst_SCRIPTS=	specgen.sh
dist_man1_MANS=		fetchmail.man

19 20 21
pys=			fetchmailconf.py
pym=			fetchmailconf.man

22
nodist_bin_SCRIPTS=	fetchmailconf
23 24
python_PYTHON=		$(pys)
dist_man1_MANS+=	$(pym)
25

Matthias Andree's avatar
Matthias Andree committed
26 27
CLEANFILES=		$(nodist_bin_SCRIPTS)

28 29 30 31 32
# for gettext (used by fetchmail.c, NOT by GNU gettext)
localedir=		$(datadir)/locale
DEFS=			@DEFS@ -DLOCALEDIR=\"$(localedir)\"

noinst_LIBRARIES=	libfm.a
33 34 35
libfm_a_SOURCES=	xmalloc.c base64.c rfc822.c report.c rfc2047e.c \
			servport.c ntlm.h smbbyteorder.h smbdes.h smbmd4.h \
			smbencrypt.h smbdes.c smbencrypt.c smbmd4.c smbutil.c \
36
			smbtypes.h fm_getaddrinfo.c starttls.c rfc822valid.c \
37
			xmalloc.h sdump.h sdump.c x509_name_match.c \
38
			fm_strl.h md5c.c
39

40 41 42
if NTLM_ENABLE
libfm_a_SOURCES += ntlmsubr.c
endif
43 44 45 46 47
libfm_a_LIBADD=		$(EXTRAOBJ)
libfm_a_DEPENDENCIES=	$(EXTRAOBJ)
LDADD	=		libfm.a @LIBINTL@ $(LIBOBJS)
DEPENDENCIES=		libfm.a $(LIBOBJS)

48 49
check_PROGRAMS=

50
TESTS=			t.smoke t.validate-xhtml10 t.validate-xhtml t.x509_name_match
51
LOG_COMPILER=		env LC_ALL=C TZ=UTC $(SHELL)
52

53 54 55 56 57 58 59
if NEED_TRIO
noinst_LIBRARIES+=	libtrio.a
libtrio_a_SOURCES=	trio/triostr.c trio/trio.c trio/trionan.c \
			trio/trio.h trio/triop.h trio/triodef.h \
			trio/trionan.h trio/triostr.h
check_PROGRAMS+=	regression
regression_SOURCES=	trio/regression.c
Matthias Andree's avatar
Matthias Andree committed
60 61
LDADD+=			libtrio.a -lm
TESTS+=			t.regression
62 63
endif

64
fetchmail_SOURCES=	fetchmail.h getopt.h \
65
		gettext.h i18n.h kerberos.h fm_md5.h mx.h netrc.h smtp.h \
66
		socket.h tunable.h \
67 68
		socket.c getpass.c \
		fetchmail.c env.c idle.c options.c daemon.c \
69
		driver.c transact.c sink.c smtp.c \
70
		idlist.c uid.c mxget.c md5ify.c cram.c gssapi.c \
71
		opie.c interface.c netrc.c \
72
		unmime.c conf.c checkalias.c uid_db.h uid_db.c\
73
		lock.h lock.c \
74 75
		rcfile_l.l rcfile_y.y \
		ucs/norm_charmap.c ucs/norm_charmap.h
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
if POP2_ENABLE
fetchmail_SOURCES += pop2.c
endif
if POP3_ENABLE
fetchmail_SOURCES += pop3.c
endif
if IMAP_ENABLE
fetchmail_SOURCES += imap.c
endif
if ETRN_ENABLE
fetchmail_SOURCES += etrn.c
endif
if ODMR_ENABLE
fetchmail_SOURCES += odmr.c
endif
if KERBEROS_V4_ENABLE
fetchmail_SOURCES += kerberos.c
endif
if RPA_ENABLE
fetchmail_SOURCES += rpa.c
endif
if NEED_GETNAMEINFO
fetchmail_SOURCES += KAME/getnameinfo.c
endif
if NEED_GETADDRINFO
fetchmail_SOURCES += libesmtp/getaddrinfo.h libesmtp/getaddrinfo.c
endif
103

104 105
check_PROGRAMS +=	rfc822 unmime netrc rfc2047e mxget rfc822valid \
			x509_name_match
106 107

rfc2047e_CFLAGS=	-DTEST
108

109 110 111
rfc822valid_CFLAGS=	-DTEST

rfc822_CFLAGS=		-DMAIN
112

113 114
x509_name_match_CFLAGS=	-DTEST

115 116 117 118 119 120
unmime_SOURCES=	unmime.c
unmime_CFLAGS=	-DSTANDALONE -DHAVE_CONFIG_H -I$(builddir)

netrc_SOURCES=	netrc.c xmalloc.c report.c
netrc_CFLAGS=	-DSTANDALONE -DHAVE_CONFIG_H -I$(builddir)

121 122 123
mxget_SOURCES=	mxget.c
mxget_CFLAGS=	-DSTANDALONE -DHAVE_CONFIG_H -I$(builddir)

124 125 126 127 128
@SET_MAKE@

fetchmail.spec: Makefile.in specgen.sh
	$(srcdir)/specgen.sh $(VERSION) >fetchmail.spec

Matthias Andree's avatar
Matthias Andree committed
129
DISTDOCS=	FAQ FEATURES NOTES OLDNEWS fetchmail-man.html \
130
		design-notes.html esrs-design-notes.html todo.html \
Matthias Andree's avatar
Matthias Andree committed
131
		fetchmail-features.html README.SSL README.NTLM \
132
		README.packaging README.SSL-SERVER \
133
		fetchmail-FAQ.book fetchmail-FAQ.pdf fetchmail-FAQ.html \
134
		Mailbox-Names-UTF7.txt Mailbox-Names-UTF7.html \
135
		fetchmail-SA-2012-02.txt \
136
		fetchmail-SA-2012-01.txt \
137
		fetchmail-SA-2011-01.txt \
138
		fetchmail-EN-2010-03.txt \
139
		fetchmail-SA-2010-02.txt \
140
		fetchmail-SA-2010-01.txt \
141
		fetchmail-SA-2009-01.txt \
142
		fetchmail-SA-2008-01.txt \
143
		fetchmail-SA-2007-02.txt \
144
		fetchmail-SA-2007-01.txt \
Matthias Andree's avatar
Matthias Andree committed
145 146
		fetchmail-SA-2006-03.txt \
		fetchmail-SA-2006-02.txt \
147
		fetchmail-SA-2006-01.txt \
148
		fetchmail-SA-2005-01.txt \
149
		fetchmail-SA-2005-02.txt \
150
		fetchmail-SA-2005-03.txt
151 152 153 154

# extra directories to ship
distdirs = rh-config contrib beos

155
EXTRA_DIST=	$(DISTDOCS) $(distdirs) \
Matthias Andree's avatar
Matthias Andree committed
156
		fetchmail.spec fetchmail.xpm \
157
		trio/CHANGES trio/README \
158
		strlcpy.3 bighand.png \
159 160
		m4/codeset.m4 \
		m4/gettext.m4 \
161
		m4/glibc2.m4 \
162 163 164
		m4/glibc21.m4 \
		m4/iconv.m4 \
		m4/intdiv0.m4 \
165 166 167
		m4/intl.m4 \
		m4/intldir.m4 \
		m4/intlmacosx.m4 \
168 169 170 171 172 173 174
		m4/intmax.m4 \
		m4/inttypes-pri.m4 \
		m4/inttypes_h.m4 \
		m4/lcmessage.m4 \
		m4/lib-ld.m4 \
		m4/lib-link.m4 \
		m4/lib-prefix.m4 \
175
		m4/lock.m4 \
176 177 178 179 180 181 182 183
		m4/longlong.m4 \
		m4/nls.m4 \
		m4/po.m4 \
		m4/printf-posix.m4 \
		m4/progtest.m4 \
		m4/size_max.m4 \
		m4/stdint_h.m4 \
		m4/uintmax_t.m4 \
184
		m4/visibility.m4 \
185 186 187
		m4/wchar_t.m4 \
		m4/wint_t.m4 \
		m4/xsize.m4 \
188
		m4-local/ac-archive-license.txt \
189
		m4-local/ac_ma_search_package.m4 \
Matthias Andree's avatar
Matthias Andree committed
190
		$(TESTS) t.rc t.regression \
191
		dist-tools/html2txt \
192 193
		dist-tools/manServer.pl \
		Doxyfile
194

195
fetchmailconf:
196
	( echo '#! /bin/sh' && echo 'exec @PYTHON@ @pythondir@/fetchmailconf.py "$$@"' ) >$@ && chmod +x $@ || { rm -f $@ ; exit 1; }
197

198
FAQ: fetchmail-FAQ.html $(srcdir)/dist-tools/html2txt
199
	AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/fetchmail-FAQ.html >$@ || { rm -f $@ ; exit 1 ; }
200

201 202
fetchmail-FAQ.pdf: fetchmail-FAQ.html fetchmail-FAQ.book bighand.png
	$(AWK) '/^[ \t]*<h1/ {sec++; } {if (sec < 2 || sec > 3) print $0;}' <$(srcdir)/fetchmail-FAQ.html >fetchmail-FAQ-print.html
203
	htmldoc --logoimage $(srcdir)/bighand.png --batch $(srcdir)/fetchmail-FAQ.book || { rm -f $@ ; exit 1 ; }
204 205
	rm -f fetchmail-FAQ-print.html

206
FEATURES: fetchmail-features.html $(srcdir)/dist-tools/html2txt
207
	AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/fetchmail-features.html >$@ || { rm -f $@ ; exit 1 ; }
208

209
NOTES: design-notes.html esrs-design-notes.html $(srcdir)/dist-tools/html2txt
210 211 212
	   echo "This file contains two articles reformatted from HTML." > $@ \
	&& echo "------------------------------------------------------" >> $@ \
	&& echo "" >> $@ \
213
	&& AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/design-notes.html >>$@ \
214 215
	&& AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/esrs-design-notes.html >>$@ \
	|| { rm -f $@ ; exit 1 ; }
216

217
TODO: todo.html $(srcdir)/dist-tools/html2txt
218
	AWK=$(AWK) $(SHELL) $(srcdir)/dist-tools/html2txt $(srcdir)/todo.html >$@ || { rm -f $@ ; exit 1 ; }
219

220
fetchmail-man.html: fetchmail.man $(srcdir)/dist-tools/manServer.pl
221
	env - "PATH=$$PATH" perl -T $(srcdir)/dist-tools/manServer.pl $(srcdir)/fetchmail.man >$@ \
222 223 224
	|| { rm -f $@ ; exit 1 ; }

dist-hook:
225
	cd $(distdir) && find $(distdirs) po -name .git -type d -prune -exec rm -rf '{}' ';'
226
	cd $(distdir) && find $(distdirs) po -name '*~' -exec rm -f '{}' ';'
227

228 229 230 231 232 233 234
# this target expects a .rsyncs file with lines of this format:
# host:directory/
# it will call rsync from its source directory to the destination for
# each of them, running them in parallel
rsync:  distdir $(srcdir)/.rsyncs
	@( cat $(srcdir)/.rsyncs | sed -e 's}^}rsync -aH --delete-after $(PACKAGE)-$(VERSION)/ }; s/\($$\)/ \&/;' ; echo "wait" ) | $(SHELL) -x

235
.PHONY: import-translations git-check
236 237 238
import-translations:
	rsync -Lrtvz translationproject.org::tp/latest/fetchmail/  $(top_srcdir)/po
	cd $(top_builddir)/po && $(MAKE) update-po
239
	@printf '\n=== You can use dist-tools/git-commit-po-updates.sh to check these updates in. ===\n\n'
240

241 242 243 244 245 246 247 248
git-check:
	@set -x && if test -d $(PACKAGE)-$(VERSION)-export ; then chmod -R u+rwX $(PACKAGE)-$(VERSION)-export ; fi && \
	rm -rf $(PACKAGE)-$(VERSION)-export && \
	mkdir $(PACKAGE)-$(VERSION)-export && \
	( cd $(top_srcdir) && git archive --format=tar HEAD ) | tar -C $(PACKAGE)-$(VERSION)-export -xf - && \
	cd $(PACKAGE)-$(VERSION)-export && chmod -R u+rwX . && autoreconf -i -f -s -v \
	&& mkdir _build && cd _build && ../configure && $(MAKE) distcheck

249 250
SUFFIXES = .html .txt
.txt.html:
251
	asciidoc --unsafe -a toc -a data-uri -o $@ $< || { rm -f $@ ; exit 1 ; }
252

253 254 255
# default to some non-default options when using "make distcheck"
AM_DISTCHECK_CONFIGURE_FLAGS=--with-ssl

256 257 258 259
# The following sets edit modes for GNU EMACS.
# Local Variables:
# compile-command:"configure"
# End: