1 # Makefile for fetchmail
3 # If you're running QNX, we can't assume a working autoconf.
4 # So just uncomment all the lines marked QNX.
9 # Ultrix 2.2 make doesn't expand the value of VPATH.
17 # CFLAGS = -g2 -5 # QNX
19 # LDFLAGS = -g2 -5 -N64k # QNX
30 # for gettext (used by fetchmail.c, NOT by GNU gettext)
31 localedir = $(datadir)/locale
33 # How to invoke ranlib. This is only used by the `glob' subdirectory.
36 # NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
37 # See also `config.h'.
38 DEFS = @DEFS@ @EXTRADEFS@ -DLOCALEDIR=\"$(localedir)\"
39 # DEFS = -DQNX -DHAVE_CONFIG_H -DHAVE_UNISTD_H -DHAVE_STDARG_H -DSTDC_HEADERS # QNX
42 # If your system needs extra libraries loaded in, define them here.
43 # In particular, add -lresolv if you are running bind 4.9.5
44 LOADLIBS = @LIBS@ @INTLLIBS@ @LEXLIB@
45 # LOADLIBS = -lsocket3r -lunix3r # QNX
47 # Any extra object files your system needs.
50 # Extra sources/objects for library functions not provided on the host system.
52 # EXTRASRC = $(srcdir)/strcasecmp.c $(srcdir)/alloca.c # QNX
53 EXTRAOBJ = @EXTRAOBJ@ @INTLOBJS@
54 # EXTRAOBJ = strcasecmp.o alloca.o getopt.o getopt1.o
58 # Common prefix for machine-independent installed files.
60 # Common prefix for machine-dependent installed files.
61 exec_prefix = @exec_prefix@
63 # Directory in which to install.
65 # Directory to install the Info files in.
67 # Directory to install data files.
69 # Number to put on the man page filename.
71 # Directory to install the man page in.
72 mandir = @mandir@/man$(manext)
74 # Toplevel build directory
76 top_srcdir = @top_srcdir@
78 # Program to install `make'.
79 INSTALL_PROGRAM = @INSTALL_PROGRAM@
80 # Program to install the man page.
81 INSTALL_DATA = @INSTALL_DATA@
82 # Generic install program.
85 # Program to format Texinfo source into Info files.
87 # Program to format Texinfo source into DVI files.
90 # Programs to make tags files.
94 protobjs = rcfile_y.o rcfile_l.o socket.o getpass.o pop2.o pop3.o imap.o \
95 etrn.o odmr.o fetchmail.o idle.o env.o options.o daemon.o driver.o \
96 transact.o sink.o rfc822.o smtp.o xmalloc.o uid.o mxget.o md5ify.o \
97 cram.o kerberos.o gssapi.o opie.o rpa.o interface.o netrc.o base64.o \
98 report.o unmime.o conf.o checkalias.o smbdes.o smbencrypt.o smbmd4.o \
99 smbutil.o ipv6-connect.o lock.o
101 objs = $(protobjs) $(extras) $(EXTRAOBJ)
103 srcs = $(srcdir)/socket.c $(srcdir)/getpass.c $(srcdir)/pop2.c \
104 $(srcdir)/pop3.c $(srcdir)/imap.c $(srcdir)/etrn.c \
105 $(srcdir)/odmr.c $(srcdir)/fetchmail.c $(srcdir)/env.c \
106 $(srcdir)/idle.c $(srcdir)/options.c $(srcdir)/daemon.c \
107 $(srcdir)/driver.c $(srcdir)/transact.c $(srcdir)/sink.c \
108 $(srcdir)/rfc822.c $(srcdir)/smtp.c $(srcdir)/xmalloc.c \
109 $(srcdir)/uid.c $(srcdir)/mxget.c $(srcdir)/md5ify.c \
110 $(srcdir)/cram.c $(srcdir)/kerberos.c $(srcdir)/gssapi.c \
111 $(srcdir)/opie.c $(srcdir)/rpa.c $(srcdir)/interface.c \
112 $(srcdir)/netrc.c $(srcdir)/base64.c $(srcdir)/report.c \
113 $(srcdir)/unmime.c $(srcdir)/conf.c $(srcdir)/checkalias.c \
114 $(srcdir)/smbdes.c $(srcdir)/smbencrypt.c $(srcdir)/smbmd4.c \
115 $(srcdir)/smbutil.c $(srcdir)/ipv6-connect.c $(srcdir)/lock.c
118 .SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi
122 # Some makes apparently use .PHONY as the default goal if it is before `all'.
125 fetchmail: $(objs) @INTLDEPS@
126 $(CC) $(LDEFLAGS) $(LDFLAGS) $(objs) $(LOADLIBS) -o fetchmail
137 # Tester for address parsing
139 gcc -DTESTMAIN -g rfc822.c -o rfc822
141 # Stand-alone MIME decoder
142 unmime: unmime.c base64.c rfc822.c xmalloc.c report.c
143 $(CC) -DSTANDALONE -DHAVE_CONFIG_H -I. -g -o $@ $^
146 # Stand-alone netrc tester
147 netrc: netrc.c xmalloc.o report.o
148 $(CC) -DSTANDALONE -DHAVE_CONFIG_H -I. -g -o $@ $^
151 $(CC) $(defines) -c $(CPFLAGS) -I. -I$(srcdir) -I$(top_builddir)/intl -I$(top_srcdir)/intl $(CEFLAGS) $(CFLAGS) $<
153 # For some losing Unix makes.
157 tagsrcs = $(srcs) rcfile_l.c rcfile_y.c
163 .PHONY: install uninstall
165 @echo "Creating installation directories..."
166 $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)
167 @echo "Installing fetchmail binary..."
168 $(INSTALL_PROGRAM) ./fetchmail $(DESTDIR)$(bindir)/fetchmail
169 @echo "Installing fetchmail configurator..."
170 $(INSTALL_PROGRAM) ${srcdir}/fetchmailconf $(DESTDIR)$(bindir)/fetchmailconf
171 @echo "Installing manual page..."
172 $(INSTALL_DATA) $(srcdir)/fetchmail.man $(DESTDIR)$(mandir)/fetchmail.$(manext)
173 rm -f $(DESTDIR)$(mandir)/fetchmailconf.$(manext)
174 cd $(DESTDIR)$(mandir) && ln -s fetchmail.$(manext) fetchmailconf.$(manext)
175 @echo "Installing language catalogs..."
176 -cd intl; $(MAKE) install
177 cd po; $(MAKE) install
180 rm -f $(DESTDIR)$(bindir)/fetchmail $(DESTDIR)$(bindir)/fetchmailconf
181 rm -f $(DESTDIR)$(mandir)/fetchmail.$(manext) $(DESTDIR)$(mandir)/fetchmailconf.$(manext)
182 -cd intl; $(MAKE) uninstall
183 cd po; $(MAKE) uninstall
185 .PHONY: clean realclean distclean mostlyclean
187 -cd intl; $(MAKE) clean
188 -rm -f $(top_builddir)/intl/libintl.h # work around GNU gettext brain-damage
189 -cd po; $(MAKE) clean
190 -rm -f fetchmail *.o core fetchmail.dvi \
191 rcfile_l.c rcfile_y.h rcfile_y.c \
192 fetchmail.tar fetchmail.tar.gz \
193 netrc rfc822 unmime fetchmail-man.html
195 # This target would also normally invoke the following line, but doing so
196 # messes up the RPM build, so the line was disabled.
197 # -rm -f config.h config.cache config.status config.log stamp-config
199 -cd intl; $(MAKE) distclean
200 -cd po; $(MAKE) distclean
204 -rm -f FAQ FEATURES NOTES MANIFEST
205 -rm -f config.cache config.log Makefile
206 -rm -f fetchmail-*.tar.gz fetchmail-*.i386.rpm
210 # These magic rules are copied from the autoconf documentation
211 # except that Harry McGavran says the autoheader call in the third
212 # one below is unnecessary and causes problems with cross-platform builds.
214 ${srcdir}/configure: configure.in aclocal.m4
215 cd ${srcdir} && @AUTOCONF@
217 # autoheader might not change config.h.in, so touch a stamp file.
218 ${srcdir}/config.h.in: stamp-h.in
220 ${srcdir}/stamp-h.in: configure.in aclocal.m4 acconfig.h # config.h.top config.h.bot
221 cd ${srcdir} # && @AUTOHEADER@
222 echo timestamp> ${srcdir}/stamp-h.in
225 stamp-h: config.h.in config.status
228 Makefile: Makefile.in config.status
231 config.status: configure
232 ./config.status --recheck
234 $(srcdir)/aclocal.m4: configure.in
235 cd $(srcdir) && @ACLOCAL@
237 # This tells versions [3.59,3.63) of GNU make not to export all variables.
240 # Special dependencies, not easily handled portably without explicit rules
241 rcfile_l.c rcfile_l.h: $(srcdir)/rcfile_l.l
242 $(LEX) $(LEXFLAGS) $(srcdir)/rcfile_l.l
243 sed <lex.yy.c >rcfile_l.c -e "/lex\\.yy\\.c/s//rcfile_l.c/"
245 rcfile_y.c rcfile_y.h: $(srcdir)/rcfile_y.y
246 @echo "expect conflicts: 2 shift/reduce"
247 $(YACC) $(YACCFLAGS) $(srcdir)/rcfile_y.y
248 mv y.tab.c rcfile_y.c
249 mv -f y.tab.h rcfile_y.h
251 # These must be explicit, because the .c files often don't exist at
252 # makefile build time.
253 rcfile_l.o: rcfile_l.c config.h fetchmail.h
254 rcfile_y.o: rcfile_y.c config.h fetchmail.h
256 parser = $(srcdir)/rcfile_l.l $(srcdir)/rcfile_y.y
257 headers = $(srcdir)/fetchmail.h $(srcdir)/socket.h $(srcdir)/smtp.h \
258 $(srcdir)/mx.h $(srcdir)/md5.h \
259 $(srcdir)/netrc.h $(srcdir)/tunable.h $(srcdir)/i18n.h \
260 $(srcdir)/ntlm.h $(srcdir)/smb.h $(srcdir)/kerberos.h \
261 $(srcdir)/smbbyteorder.h $(srcdir)/smbdes.h $(srcdir)/smbencrypt.h \
263 extra = $(srcdir)/alloca.c $(srcdir)/strcasecmp.c $(srcdir)/strstr.c \
264 $(srcdir)/memmove.c $(srcdir)/md5c.c $(srcdir)/getopt.[ch] $(srcdir)/getopt1.c
265 docs = $(srcdir)/COPYING $(srcdir)/FEATURES $(srcdir)/fetchmail-features.html \
266 $(srcdir)/design-notes.html $(srcdir)/NOTES \
267 $(srcdir)/todo.html $(srcdir)/TODO \
268 $(srcdir)/INSTALL $(srcdir)/README $(srcdir)/README.SSL \
269 $(srcdir)/README.NTLM $(srcdir)/fetchmail.lsm $(srcdir)/NEWS \
270 $(srcdir)/*.man $(srcdir)/FAQ $(srcdir)/fetchmail-FAQ.html
271 config = $(srcdir)/Makefile.in $(srcdir)/configure.in $(srcdir)/configure \
272 $(srcdir)/config.guess $(srcdir)/config.h.in $(srcdir)/config.sub \
273 $(srcdir)/acconfig.h $(srcdir)/aclocal.m4
274 scripts = $(srcdir)/install-sh $(srcdir)/missing $(srcdir)/mkinstalldirs \
275 $(srcdir)/specgen.sh $(srcdir)/lsmgen.py $(srcdir)/fetchmailconf
276 all = $(docs) $(config) $(srcs) $(parser) $(headers) $(extra) $(scripts) \
277 $(srcdir)/rh-config/* $(srcdir)/contrib/*[A-Za-uw-z] \
278 $(srcdir)/po/* $(srcdir)/intl $(srcdir)/beos/* ABOUT-NLS $(srcdir)/MANIFEST
280 MANIFEST: $(srcdir) Makefile.in
281 @echo $(all) | tr "[ \t]" '\n' | sed -e '/^\.\//s///' | sort >MANIFEST
284 distdocs: FAQ FEATURES NOTES fetchmail-man.html
286 FAQ: fetchmail-FAQ.html
287 echo " (This document was generated from fetchmail-FAQ.html)" >FAQ
288 lynx -dump -nolist fetchmail-FAQ.html >>FAQ
290 FEATURES: fetchmail-features.html
291 echo " (This document was generated from fetchmail-features.html)" >FEATURES
292 lynx -dump -nolist fetchmail-features.html | grep -v "Back to " >>FEATURES
294 NOTES: design-notes.html
295 echo " (This document was generated from design-notes.html)" >NOTES
296 lynx -dump -nolist design-notes.html | grep -v "Back to " >>NOTES
299 echo " (This document was generated from todo.html)" >TODO
300 lynx -dump -nolist todo.html | grep -v "Back to " >>TODO
302 # man2html no longer chokes and dies on this man page,
303 # but manServer.pl does a much better job.
304 fetchmail-man.html: fetchmail.man
305 manServer.pl fetchmail.man >fetchmail-man.html
307 # Make distribution, update LSM with proper size, remake distribution
308 # (Making fetchmail-man.html is a kluge to ensure that it will be
309 # available when I upload the distribution.)
310 dist: distclean MANIFEST Makefile.in distdocs
312 make fetchmail-$(VERSION).tar.gz
313 lsmgen.py $(VERSION) `wc -c fetchmail-$(VERSION).tar.gz` >fetchmail.lsm
314 make fetchmail-$(VERSION).tar.gz
315 #-cd po; make update-po
316 ls -l fetchmail-$(VERSION).tar.gz
317 @echo "Don't forget to build RPMs from root!"
319 # Firewall against the lossage in autoconf that keeps breaking our build.
320 EX = --exclude "fetchmail-$(VERSION)/intl/libintl.h"
321 fetchmail-$(VERSION).tar.gz: $(all)
322 (cd ..; ln -sf fetchmail fetchmail-$(VERSION))
323 (cd ..; tar $(EX) -czf fetchmail-$(VERSION).tar.gz `sed <fetchmail-$(VERSION)/MANIFEST s:^:fetchmail-$(VERSION)/:`)
324 mv -f ../fetchmail-$(VERSION).tar.gz .
325 rm ../fetchmail-$(VERSION)
327 # Make RPMs. You need to be root to make this work
328 RPMROOT=/usr/src/redhat
332 cp fetchmail-$(VERSION).tar.gz fetchmail.xpm $(RPMROOT)/SOURCES;
333 $(srcdir)/specgen.sh $(VERSION) >$(RPMROOT)/SPECS/fetchmail.spec
334 cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) fetchmail.spec
335 cp $(RPMROOT)/RPMS/`arch|sed 's/i[4-9]86/i386/'`/fetchmail*-$(VERSION)*.rpm $(srcdir)
336 cp $(RPMROOT)/SRPMS/fetchmail*-$(VERSION)*.src.rpm $(srcdir)
338 # The following sets edit modes for GNU EMACS.
340 # compile-command:"configure"
343 # Automatically generated dependencies will be put at the end of the makefile.