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.
11 # Ultrix 2.2 make doesn't expand the value of VPATH.
18 CFLAGS = @CFLAGS@ -I$(top_srcdir)/intl
19 # CFLAGS = -g2 -5 # QNX
21 # LDFLAGS = -g2 -5 -N64k # QNX
35 localedir = @LOCALE_DIR@
37 # How to invoke ranlib. This is only used by the `glob' subdirectory.
40 # NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
41 # See also `config.h'.
42 DEFS = @DEFS@ @EXTRADEFS@ -DLOCALEDIR=\"$(localedir)\"
43 # DEFS = -DQNX -DHAVE_CONFIG_H -DHAVE_UNISTD_H -DHAVE_STDARG_H -DSTDC_HEADERS # QNX
46 # If your system needs extra libraries loaded in, define them here.
47 # In particular, add -lresolv if you are running bind 4.9.5
48 LOADLIBS = @LIBS@ @LEXLIB@
49 # LOADLIBS = -lsocket3r -lunix3r # QNX
51 # Any extra object files your system needs.
52 extras = @LIBOBJS@ $(INTLDEPS)
54 # Extra sources/objects for library functions not provided on the host system.
56 # EXTRASRC = $(srcdir)/strcasecmp.c $(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/alloca.c # QNX
58 # EXTRAOBJ = strcasecmp.o getopt.o getopt1.o alloca.o
62 # Common prefix for machine-independent installed files.
64 # Common prefix for machine-dependent installed files.
65 exec_prefix = @exec_prefix@
67 # Directory in which to install.
69 # Directory to install the Info files in.
71 # Directory to install data files.
73 # Number to put on the man page filename.
75 # Directory to install the man page in.
76 mandir = @mandir@/man$(manext)
78 # Toplevel build directory
80 top_srcdir = @top_srcdir@
82 # Program to install `make'.
83 INSTALL_PROGRAM = @INSTALL_PROGRAM@
84 # Program to install the man page.
85 INSTALL_DATA = @INSTALL_DATA@
86 # Generic install program.
89 # Program to format Texinfo source into Info files.
91 # Program to format Texinfo source into DVI files.
94 # Programs to make tags files.
98 protobjs = rcfile_y.o rcfile_l.o socket.o getpass.o pop2.o pop3.o imap.o \
99 etrn.o odmr.o fetchmail.o idle.o env.o options.o daemon.o driver.o \
100 sink.o rfc822.o smtp.o xmalloc.o uid.o mxget.o md5ify.o cram.o \
101 kerberos.o gssapi.o opie.o rpa.o interface.o netrc.o base64.o \
102 error.o unmime.o conf.o checkalias.o smbdes.o smbencrypt.o smbmd4.o \
103 smbutil.o ipv6-connect.o
105 objs = $(protobjs) $(extras) $(EXTRAOBJ)
107 srcs = $(srcdir)/socket.c $(srcdir)/getpass.c $(srcdir)/pop2.c \
108 $(srcdir)/pop3.c $(srcdir)/imap.c $(srcdir)/etrn.c \
109 $(srcdir)/odmr.c $(srcdir)/fetchmail.c $(srcdir)/env.c \
110 $(srcdir)/idle.c $(srcdir)/options.c $(srcdir)/daemon.c \
111 $(srcdir)/driver.c $(srcdir)/sink.c $(srcdir)/rfc822.c \
112 $(srcdir)/smtp.c $(srcdir)/xmalloc.c $(srcdir)/uid.c \
113 $(srcdir)/mxget.c $(srcdir)/md5ify.c $(srcdir)/cram.c \
114 $(srcdir)/kerberos.c $(srcdir)/gssapi.c $(srcdir)/opie.c \
115 $(srcdir)/rpa.c $(srcdir)/interface.c $(srcdir)/netrc.c \
116 $(srcdir)/base64.c $(srcdir)/error.c $(srcdir)/unmime.c \
117 $(srcdir)/conf.c $(srcdir)/checkalias.c $(srcdir)/smbdes.c \
118 $(srcdir)/smbencrypt.c $(srcdir)/smbmd4.c $(srcdir)/smbutil.c \
119 $(srcdir)/ipv6-connect.c
122 .SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi
126 # Some makes apparently use .PHONY as the default goal if it is before `all'.
130 $(CC) $(LDEFLAGS) $(LDFLAGS) $(objs) $(LOADLIBS) -o fetchmail
136 @echo "Making $@ in intl"; \
137 cd intl; $(MAKE) || exit 1
141 # Tester for address parsing
143 gcc -DTESTMAIN -g rfc822.c -o rfc822
145 # Stand-alone MIME decoder
146 unmime: unmime.c base64.c rfc822.c xmalloc.c error.c
147 $(CC) -DSTANDALONE -DHAVE_CONFIG_H -I. -g -o $@ $^
150 # Stand-alone netrc tester
151 netrc: netrc.c xmalloc.o error.o
152 $(CC) -DSTANDALONE -DHAVE_CONFIG_H -I. -g -o $@ $^
155 $(CC) $(defines) -c $(CPFLAGS) -I. -I$(srcdir) $(CEFLAGS) $(CFLAGS) $<
157 # For some losing Unix makes.
161 tagsrcs = $(srcs) rcfile_l.c rcfile_y.c
167 .PHONY: install uninstall
169 @echo "Creating installation directories..."
170 $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)
171 @echo "Installing fetchmail binary..."
172 $(INSTALL_PROGRAM) ./fetchmail $(DESTDIR)$(bindir)/fetchmail
173 @echo "Installing fetchmail configurator..."
174 $(INSTALL_PROGRAM) ${srcdir}/fetchmailconf $(DESTDIR)$(bindir)/fetchmailconf
175 @echo "Installing manual page..."
176 $(INSTALL_DATA) $(srcdir)/fetchmail.man $(DESTDIR)$(mandir)/fetchmail.$(manext)
177 rm -f $(DESTDIR)$(mandir)/fetchmailconf.$(manext)
178 cd $(DESTDIR)$(mandir) && ln -s fetchmail.$(manext) fetchmailconf.$(manext)
179 @echo "Installing language catalogs..."
183 rm -f $(DESTDIR)$(bindir)/fetchmail $(DESTDIR)$(bindir)/fetchmailconf
184 rm -f $(DESTDIR)$(mandir)/fetchmail.$(manext) $(DESTDIR)$(mandir)/fetchmailconf.$(manext)
187 .PHONY: clean realclean distclean mostlyclean
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
197 -rm -f Makefile config.h TAGS tags
198 -rm -f config.cache config.status config.log stamp-config
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 -I m4
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/"
242 rcfile_y.c rcfile_y.h: $(srcdir)/rcfile_y.y
243 @echo "expect conflicts: 2 shift/reduce"
244 $(YACC) $(YACCFLAGS) $(srcdir)/rcfile_y.y
245 mv y.tab.c rcfile_y.c
246 mv -f y.tab.h rcfile_y.h
248 # These must be explicit, because the .c files often don't exist at
249 # makefile build time.
250 rcfile_l.o: rcfile_y.c rcfile_y.h config.h fetchmail.h
251 rcfile_y.o: rcfile_y.c rcfile_y.h config.h fetchmail.h
253 parser = $(srcdir)/rcfile_l.l $(srcdir)/rcfile_y.y
254 headers = $(srcdir)/fetchmail.h $(srcdir)/socket.h $(srcdir)/smtp.h \
255 $(srcdir)/mx.h $(srcdir)/md5.h $(srcdir)/md5global.h \
256 $(srcdir)/netrc.h $(srcdir)/tunable.h $(srcdir)/i18n.h \
257 $(srcdir)/aclocal.m4 $(srcdir)/ntlm.h $(srcdir)/smb.h \
258 $(srcdir)/smbbyteorder.h $(srcdir)/smbdes.h $(srcdir)/smbencrypt.h \
260 extra = $(srcdir)/alloca.c $(srcdir)/getopt.[ch] $(srcdir)/getopt1.c \
261 $(srcdir)/strcasecmp.c $(srcdir)/strstr.c $(srcdir)/memmove.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)/NEWS $(srcdir)/README \
267 $(srcdir)/README.NTLM $(srcdir)/fetchmail.lsm \
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 \
272 scripts = $(srcdir)/install.sh $(srcdir)/mkinstalldirs \
273 $(srcdir)/specgen.sh $(srcdir)/lsmgen.sh $(srcdir)/fetchmailconf
274 all = $(docs) $(config) $(srcs) $(parser) $(headers) $(extra) $(scripts) \
275 $(srcdir)/rh-config/* $(srcdir)/debian/* $(srcdir)/contrib/*[A-Za-uw-z] \
276 $(srcdir)/intl/* $(srcdir)/po/* $(srcdir)/beos/* ABOUT-NLS \
279 MANIFEST: $(srcdir) Makefile.in
280 @echo $(all) | tr "[ \t]" '\n' | sed -e '/^\.\//s///' | sort >MANIFEST
283 distdocs: FAQ FEATURES NOTES fetchmail-man.html
285 FAQ: fetchmail-FAQ.html
286 echo " (This document was generated from fetchmail-FAQ.html)" >FAQ
287 lynx -dump -nolist fetchmail-FAQ.html >>FAQ
289 FEATURES: fetchmail-features.html
290 echo " (This document was generated from fetchmail-features.html)" >FEATURES
291 lynx -dump -nolist fetchmail-features.html | grep -v "Back to " >>FEATURES
293 NOTES: design-notes.html
294 echo " (This document was generated from design-notes.html)" >NOTES
295 lynx -dump -nolist design-notes.html | grep -v "Back to " >>NOTES
298 echo " (This document was generated from todo.html)" >TODO
299 lynx -dump -nolist todo.html | grep -v "Back to " >>TODO
301 # man2html no longer chokes and dies on this man page,
302 # but manServer.pl does a much better job.
303 fetchmail-man.html: fetchmail.man
304 manServer.pl fetchmail.man >fetchmail-man.html
306 # Make distribution, update LSM with proper size, remake distribution
307 # (Making fetchmail-man.html is a kluge to ensure that it will be
308 # available when I upload the distribution.)
309 dist: Makefile.in distdocs
310 rm -f MANIFEST; make MANIFEST;
312 make fetchmail-$(VERSION).tar.gz
313 lsmgen.sh $(VERSION) `wc -c fetchmail-$(VERSION).tar.gz` >fetchmail.lsm
314 make fetchmail-$(VERSION).tar.gz
315 ls -l fetchmail-$(VERSION).tar.gz
316 @echo "Don't forget to build RPMs from root!"
318 fetchmail-$(VERSION).tar.gz: $(all)
319 (cd ..; ln -sf fetchmail fetchmail-$(VERSION))
320 (cd ..; tar -czf fetchmail-$(VERSION).tar.gz `sed <fetchmail-$(VERSION)/MANIFEST s:^:fetchmail-$(VERSION)/:`)
321 mv -f ../fetchmail-$(VERSION).tar.gz .
322 rm ../fetchmail-$(VERSION)
324 # Make RPMs. You need to be root to make this work
325 RPMROOT=/usr/src/redhat
329 cp fetchmail-$(VERSION).tar.gz fetchmail.xpm $(RPMROOT)/SOURCES;
330 $(srcdir)/specgen.sh $(VERSION) >$(RPMROOT)/SPECS/fetchmail.spec
331 cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) fetchmail.spec
332 cp $(RPMROOT)/RPMS/`arch|sed 's/i[4-9]86/i386/'`/fetchmail*-$(VERSION)*.rpm $(srcdir)
333 cp $(RPMROOT)/SRPMS/fetchmail*-$(VERSION)*.src.rpm $(srcdir)
335 # The following sets edit modes for GNU EMACS.
337 # compile-command:"configure"
340 # Automatically generated dependencies will be put at the end of the makefile.