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 # Extra sources/objects for library functions not provided on the host system.
49 # EXTRASRC = $(srcdir)/strcasecmp.c $(srcdir)/alloca.c # QNX
50 EXTRAOBJ = @EXTRAOBJ@ @INTLOBJS@
51 # EXTRAOBJ = strcasecmp.o alloca.o getopt.o getopt1.o
55 # Common prefix for machine-independent installed files.
57 # Common prefix for machine-dependent installed files.
58 exec_prefix = @exec_prefix@
60 # Directory in which to install.
62 # Directory to install the Info files in.
64 # Directory to install data files.
66 # Number to put on the man page filename.
68 # Directory to install the man page in.
69 mandir = @mandir@/man$(manext)
71 # Toplevel build directory
73 top_srcdir = @top_srcdir@
75 # Program to install `make'.
76 INSTALL_PROGRAM = @INSTALL_PROGRAM@
77 # Program to install the man page.
78 INSTALL_DATA = @INSTALL_DATA@
79 # Generic install program.
82 # Program to format Texinfo source into Info files.
84 # Program to format Texinfo source into DVI files.
87 # Programs to make tags files.
91 protobjs = rcfile_y.o rcfile_l.o socket.o getpass.o pop2.o pop3.o imap.o \
92 etrn.o odmr.o fetchmail.o idle.o env.o options.o daemon.o driver.o \
93 transact.o sink.o rfc822.o smtp.o xmalloc.o uid.o mxget.o md5ify.o \
94 cram.o kerberos.o gssapi.o opie.o rpa.o interface.o netrc.o base64.o \
95 report.o unmime.o conf.o checkalias.o smbdes.o smbencrypt.o smbmd4.o \
96 smbutil.o ipv6-connect.o lock.o
98 objs = $(protobjs) $(EXTRAOBJ)
100 srcs = $(srcdir)/socket.c $(srcdir)/getpass.c $(srcdir)/pop2.c \
101 $(srcdir)/pop3.c $(srcdir)/imap.c $(srcdir)/etrn.c \
102 $(srcdir)/odmr.c $(srcdir)/fetchmail.c $(srcdir)/env.c \
103 $(srcdir)/idle.c $(srcdir)/options.c $(srcdir)/daemon.c \
104 $(srcdir)/driver.c $(srcdir)/transact.c $(srcdir)/sink.c \
105 $(srcdir)/rfc822.c $(srcdir)/smtp.c $(srcdir)/xmalloc.c \
106 $(srcdir)/uid.c $(srcdir)/mxget.c $(srcdir)/md5ify.c \
107 $(srcdir)/cram.c $(srcdir)/kerberos.c $(srcdir)/gssapi.c \
108 $(srcdir)/opie.c $(srcdir)/rpa.c $(srcdir)/interface.c \
109 $(srcdir)/netrc.c $(srcdir)/base64.c $(srcdir)/report.c \
110 $(srcdir)/unmime.c $(srcdir)/conf.c $(srcdir)/checkalias.c \
111 $(srcdir)/smbdes.c $(srcdir)/smbencrypt.c $(srcdir)/smbmd4.c \
112 $(srcdir)/smbutil.c $(srcdir)/ipv6-connect.c $(srcdir)/lock.c
115 .SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi
119 # Some makes apparently use .PHONY as the default goal if it is before `all'.
122 fetchmail: $(objs) @INTLDEPS@
123 $(CC) $(LDEFLAGS) $(LDFLAGS) $(objs) $(LOADLIBS) -o fetchmail
134 # Tester for address parsing
136 gcc -DMAIN -g rfc822.c -o rfc822
138 # Stand-alone MIME decoder
139 unmime: unmime.c base64.c rfc822.c xmalloc.c report.c
140 $(CC) -DSTANDALONE -DHAVE_CONFIG_H -I. -g -o $@ $^
143 # Stand-alone netrc tester
144 netrc: netrc.c xmalloc.o report.o
145 $(CC) -DSTANDALONE -DHAVE_CONFIG_H -I. -g -o $@ $^
148 $(CC) $(defines) -c $(CPFLAGS) -I. -I$(srcdir) -I$(top_builddir)/intl -I$(top_srcdir)/intl $(CEFLAGS) $(CFLAGS) $<
150 # For some losing Unix makes.
154 tagsrcs = $(srcs) rcfile_l.c rcfile_y.c
160 .PHONY: install uninstall
162 @echo "Creating installation directories..."
163 $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)
164 @echo "Installing fetchmail binary..."
165 $(INSTALL_PROGRAM) ./fetchmail $(DESTDIR)$(bindir)/fetchmail
166 @echo "Installing fetchmail configurator..."
167 $(INSTALL_PROGRAM) ${srcdir}/fetchmailconf $(DESTDIR)$(bindir)/fetchmailconf
168 @echo "Installing manual page..."
169 $(INSTALL_DATA) $(srcdir)/fetchmail.man $(DESTDIR)$(mandir)/fetchmail.$(manext)
170 rm -f $(DESTDIR)$(mandir)/fetchmailconf.$(manext)
171 cd $(DESTDIR)$(mandir) && ln -s fetchmail.$(manext) fetchmailconf.$(manext)
172 @echo "Installing language catalogs..."
173 -cd intl; $(MAKE) install
174 cd po; $(MAKE) install
177 rm -f $(DESTDIR)$(bindir)/fetchmail $(DESTDIR)$(bindir)/fetchmailconf
178 rm -f $(DESTDIR)$(mandir)/fetchmail.$(manext) $(DESTDIR)$(mandir)/fetchmailconf.$(manext)
179 -cd intl; $(MAKE) uninstall
180 cd po; $(MAKE) uninstall
182 .PHONY: clean realclean distclean mostlyclean
184 -cd intl; $(MAKE) clean
185 -rm -f $(top_builddir)/intl/libintl.h # work around GNU gettext brain-damage
186 -cd po; $(MAKE) clean
187 -rm -f fetchmail *.o core fetchmail.dvi \
188 rcfile_l.c rcfile_y.h rcfile_y.c \
189 fetchmail.tar fetchmail.tar.gz \
190 netrc rfc822 unmime fetchmail-man.html
192 # This target would also normally invoke the following line, but doing so
193 # messes up the RPM build, so the line was disabled.
194 # -rm -f config.h config.cache config.status config.log stamp-config
196 -cd intl; $(MAKE) distclean
197 -cd po; $(MAKE) distclean
198 -rm -f TAGS tags config.h config.log \
199 config.cache stamp-h stamp-h.in # config.status Makefile
202 -rm -f FAQ FEATURES NOTES MANIFEST
203 -rm -f config.cache config.log Makefile
204 -rm -f fetchmail-*.tar.gz fetchmail-*.i386.rpm
208 # These magic rules are copied from the autoconf documentation
209 # except that Harry McGavran says the autoheader call in the third
210 # one below is unnecessary and causes problems with cross-platform builds.
212 ${srcdir}/configure: configure.in aclocal.m4
213 cd ${srcdir} && @AUTOCONF@
215 # autoheader might not change config.h.in, so touch a stamp file.
216 ${srcdir}/config.h.in: stamp-h.in
218 ${srcdir}/stamp-h.in: configure.in aclocal.m4 acconfig.h # config.h.top config.h.bot
219 cd ${srcdir} # && @AUTOHEADER@
220 echo timestamp> ${srcdir}/stamp-h.in
223 stamp-h: config.h.in config.status
226 Makefile: Makefile.in config.status
229 config.status: configure
230 ./config.status --recheck
232 $(srcdir)/aclocal.m4: configure.in
233 cd $(srcdir) && @ACLOCAL@
235 # This tells versions [3.59,3.63) of GNU make not to export all variables.
238 # Special dependencies, not easily handled portably without explicit rules
239 rcfile_l.c rcfile_l.h: $(srcdir)/rcfile_l.l
240 $(LEX) $(LEXFLAGS) $(srcdir)/rcfile_l.l
241 sed <lex.yy.c >rcfile_l.c -e "/lex\\.yy\\.c/s//rcfile_l.c/"
243 rcfile_y.c rcfile_y.h: $(srcdir)/rcfile_y.y
244 @echo "expect conflicts: 2 shift/reduce"
245 $(YACC) $(YACCFLAGS) $(srcdir)/rcfile_y.y
246 mv y.tab.c rcfile_y.c
247 mv -f y.tab.h rcfile_y.h
249 # These must be explicit, because the .c files often don't exist at
250 # makefile build time.
251 rcfile_l.o: rcfile_l.c config.h fetchmail.h
252 rcfile_y.o: rcfile_y.c config.h fetchmail.h
254 parser = $(srcdir)/rcfile_l.l $(srcdir)/rcfile_y.y
255 headers = $(srcdir)/fetchmail.h $(srcdir)/socket.h $(srcdir)/smtp.h \
256 $(srcdir)/mx.h $(srcdir)/md5.h \
257 $(srcdir)/netrc.h $(srcdir)/tunable.h $(srcdir)/i18n.h \
258 $(srcdir)/ntlm.h $(srcdir)/smb.h $(srcdir)/kerberos.h \
259 $(srcdir)/smbbyteorder.h $(srcdir)/smbdes.h $(srcdir)/smbencrypt.h \
261 extra = $(srcdir)/alloca.c $(srcdir)/strcasecmp.c $(srcdir)/strstr.c \
262 $(srcdir)/memmove.c $(srcdir)/md5c.c $(srcdir)/getopt.[ch] $(srcdir)/getopt1.c
263 docs = $(srcdir)/COPYING $(srcdir)/FEATURES $(srcdir)/fetchmail-features.html \
264 $(srcdir)/design-notes.html $(srcdir)/NOTES \
265 $(srcdir)/todo.html $(srcdir)/TODO \
266 $(srcdir)/INSTALL $(srcdir)/README $(srcdir)/README.SSL \
267 $(srcdir)/README.NTLM $(srcdir)/fetchmail.lsm $(srcdir)/NEWS \
268 $(srcdir)/*.man $(srcdir)/FAQ $(srcdir)/fetchmail-FAQ.html
269 config = $(srcdir)/Makefile.in $(srcdir)/configure.in $(srcdir)/configure \
270 $(srcdir)/config.guess $(srcdir)/config.h.in $(srcdir)/config.sub \
271 $(srcdir)/acconfig.h $(srcdir)/aclocal.m4
272 scripts = $(srcdir)/install-sh $(srcdir)/missing $(srcdir)/mkinstalldirs \
273 $(srcdir)/specgen.sh $(srcdir)/fetchmailconf
274 all = $(docs) $(config) $(srcs) $(parser) $(headers) $(extra) $(scripts) \
275 $(srcdir)/rh-config/* $(srcdir)/contrib/*[A-Za-uw-z] \
276 $(srcdir)/po/* $(srcdir)/intl $(srcdir)/beos/* ABOUT-NLS $(srcdir)/MANIFEST
278 MANIFEST: $(srcdir) Makefile.in
279 @echo $(all) | tr "[ \t]" '\n' | sed -e '/^\.\//s///' | sort >MANIFEST
282 distdocs: FAQ FEATURES NOTES fetchmail-man.html
284 FAQ: fetchmail-FAQ.html
285 echo " (This document was generated from fetchmail-FAQ.html)" >FAQ
286 lynx -dump -nolist fetchmail-FAQ.html >>FAQ
288 FEATURES: fetchmail-features.html
289 echo " (This document was generated from fetchmail-features.html)" >FEATURES
290 lynx -dump -nolist fetchmail-features.html | grep -v "Back to " >>FEATURES
292 NOTES: design-notes.html
293 echo " (This document was generated from design-notes.html)" >NOTES
294 lynx -dump -nolist design-notes.html | grep -v "Back to " >>NOTES
297 echo " (This document was generated from todo.html)" >TODO
298 lynx -dump -nolist todo.html | grep -v "Back to " >>TODO
300 # man2html no longer chokes and dies on this man page,
301 # but manServer.pl does a much better job.
302 fetchmail-man.html: fetchmail.man
303 manServer.pl fetchmail.man >fetchmail-man.html
306 dist: distclean MANIFEST Makefile.in distdocs
308 make fetchmail-$(VERSION).tar.gz
309 #-cd po; make update-po
310 ls -l fetchmail-$(VERSION).tar.gz
311 @echo "Don't forget to build RPMs from root!"
313 # Firewall against the lossage in autoconf that keeps breaking our build.
314 EX = --exclude "fetchmail-$(VERSION)/intl/libintl.h"
315 fetchmail-$(VERSION).tar.gz: $(all)
316 (cd ..; ln -sf fetchmail fetchmail-$(VERSION))
317 (cd ..; tar $(EX) -czf fetchmail-$(VERSION).tar.gz `sed <fetchmail-$(VERSION)/MANIFEST s:^:fetchmail-$(VERSION)/:`)
318 mv -f ../fetchmail-$(VERSION).tar.gz .
319 rm ../fetchmail-$(VERSION)
321 # Make RPMs. You need to be root to make this work
322 RPMROOT=/usr/src/redhat
326 cp fetchmail-$(VERSION).tar.gz fetchmail.xpm $(RPMROOT)/SOURCES;
327 $(srcdir)/specgen.sh $(VERSION) >$(RPMROOT)/SPECS/fetchmail.spec
328 cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) fetchmail.spec
329 cp $(RPMROOT)/RPMS/`arch|sed 's/i[4-9]86/i386/'`/fetchmail*-$(VERSION)*.rpm $(srcdir)
330 cp $(RPMROOT)/SRPMS/fetchmail*-$(VERSION)*.src.rpm $(srcdir)
332 # The following sets edit modes for GNU EMACS.
334 # compile-command:"configure"
337 # Automatically generated dependencies will be put at the end of the makefile.