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
36 # How to invoke ranlib. This is only used by the `glob' subdirectory.
39 # NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
40 # See also `config.h'.
41 DEFS = @DEFS@ @EXTRADEFS@
42 # DEFS = -DQNX -DHAVE_CONFIG_H -DHAVE_UNISTD_H -DHAVE_STDARG_H -DSTDC_HEADERS # QNX
45 # If your system needs extra libraries loaded in, define them here.
46 # In particular, add -lresolv if you are running bind 4.9.5
47 LOADLIBS = @LIBS@ @LEXLIB@
48 # LOADLIBS = -lsocket3r -lunix3r # QNX
50 # Any extra object files your system needs.
51 extras = @LIBOBJS@ $(INTLDEPS)
53 # Extra sources/objects for library functions not provided on the host system.
55 # EXTRASRC = $(srcdir)/strcasecmp.c $(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/alloca.c # QNX
57 # EXTRAOBJ = strcasecmp.o getopt.o getopt1.o alloca.o
61 # Common prefix for machine-independent installed files.
63 # Common prefix for machine-dependent installed files.
64 exec_prefix = @exec_prefix@
66 # Directory in which to install.
68 # Directory to install the Info files in.
70 # Directory to install data files.
72 # Number to put on the man page filename.
74 # Directory to install the man page in.
75 mandir = @mandir@/man$(manext)
77 # Toplevel build directory
79 top_srcdir = @top_srcdir@
81 # Program to install `make'.
82 INSTALL_PROGRAM = @INSTALL_PROGRAM@
83 # Program to install the man page.
84 INSTALL_DATA = @INSTALL_DATA@
85 # Generic install program.
88 # Program to format Texinfo source into Info files.
90 # Program to format Texinfo source into DVI files.
93 # Programs to make tags files.
97 protobjs = rcfile_y.o rcfile_l.o socket.o getpass.o pop2.o pop3.o imap.o \
98 etrn.o odmr.o fetchmail.o idle.o env.o options.o daemon.o driver.o \
99 sink.o rfc822.o smtp.o xmalloc.o uid.o mxget.o md5ify.o cram.o \
100 kerberos.o gssapi.o opie.o rpa.o interface.o netrc.o base64.o \
101 error.o unmime.o conf.o checkalias.o smbdes.o smbencrypt.o smbmd4.o \
102 smbutil.o ipv6-connect.o
104 objs = $(protobjs) $(extras) $(EXTRAOBJ)
106 srcs = $(srcdir)/socket.c $(srcdir)/getpass.c $(srcdir)/pop2.c \
107 $(srcdir)/pop3.c $(srcdir)/imap.c $(srcdir)/etrn.c \
108 $(srcdir)/odmr.c $(srcdir)/fetchmail.c $(srcdir)/env.c \
109 $(srcdir)/idle.c $(srcdir)/options.c $(srcdir)/daemon.c \
110 $(srcdir)/driver.c $(srcdir)/sink.c $(srcdir)/rfc822.c \
111 $(srcdir)/smtp.c $(srcdir)/xmalloc.c $(srcdir)/uid.c \
112 $(srcdir)/mxget.c $(srcdir)/md5ify.c $(srcdir)/cram.c \
113 $(srcdir)/kerberos.c $(srcdir)/gssapi.c $(srcdir)/opie.c \
114 $(srcdir)/rpa.c $(srcdir)/interface.c $(srcdir)/netrc.c \
115 $(srcdir)/base64.c $(srcdir)/error.c $(srcdir)/unmime.c \
116 $(srcdir)/conf.c $(srcdir)/checkalias.c $(srcdir)/smbdes.c \
117 $(srcdir)/smbencrypt.c $(srcdir)/smbmd4.c $(srcdir)/smbutil.c \
118 $(srcdir)/ipv6-connect.c
121 .SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi
125 # Some makes apparently use .PHONY as the default goal if it is before `all'.
129 $(CC) $(LDEFLAGS) $(LDFLAGS) $(objs) $(LOADLIBS) -o fetchmail
135 @echo "Making $@ in intl"; \
136 cd intl; $(MAKE) || exit 1
140 # Tester for address parsing
142 gcc -DTESTMAIN -g rfc822.c -o rfc822
144 # Stand-alone MIME decoder
145 unmime: unmime.c base64.c rfc822.c xmalloc.c error.c
146 $(CC) -DSTANDALONE -DHAVE_CONFIG_H -I. -g -o $@ $^
149 # Stand-alone netrc tester
150 netrc: netrc.c xmalloc.o error.o
151 $(CC) -DSTANDALONE -DHAVE_CONFIG_H -I. -g -o $@ $^
154 $(CC) $(defines) -c $(CPFLAGS) -I. -I$(srcdir) $(CEFLAGS) $(CFLAGS) $<
156 # For some losing Unix makes.
160 tagsrcs = $(srcs) rcfile_l.c rcfile_y.c
166 .PHONY: install uninstall
168 @echo "Creating installation directories..."
169 $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)
170 @echo "Installing fetchmail binary..."
171 $(INSTALL_PROGRAM) ./fetchmail $(DESTDIR)$(bindir)/fetchmail
172 @echo "Installing fetchmail configurator..."
173 $(INSTALL_PROGRAM) ${srcdir}/fetchmailconf $(DESTDIR)$(bindir)/fetchmailconf
174 @echo "Installing manual page..."
175 $(INSTALL_DATA) $(srcdir)/fetchmail.man $(DESTDIR)$(mandir)/fetchmail.$(manext)
176 rm -f $(DESTDIR)$(mandir)/fetchmailconf.$(manext)
177 cd $(DESTDIR)$(mandir) && ln -s fetchmail.$(manext) fetchmailconf.$(manext)
178 @echo "Installing language catalogs..."
182 rm -f $(DESTDIR)$(bindir)/fetchmail $(DESTDIR)$(bindir)/fetchmailconf
183 rm -f $(DESTDIR)$(mandir)/fetchmail.$(manext) $(DESTDIR)$(mandir)/fetchmailconf.$(manext)
186 .PHONY: clean realclean distclean mostlyclean
189 -rm -f fetchmail *.o core fetchmail.dvi \
190 rcfile_l.c rcfile_y.h rcfile_y.c \
191 fetchmail.tar fetchmail.tar.gz \
192 netrc rfc822 unmime fetchmail-man.html
196 -rm -f Makefile config.h TAGS tags
197 -rm -f config.cache config.status config.log stamp-config
201 -rm -f FAQ FEATURES NOTES MANIFEST
202 -rm -f config.cache config.log Makefile
203 -rm -f fetchmail-*.tar.gz fetchmail-*.i386.rpm
207 # These magic rules are copied from the autoconf documentation
208 # except that Harry McGavran says the autoheader call in the third
209 # one below is unnecessary and causes problems with cross-platform builds.
211 ${srcdir}/configure: configure.in aclocal.m4
212 cd ${srcdir} && autoconf
214 # autoheader might not change config.h.in, so touch a stamp file.
215 ${srcdir}/config.h.in: stamp-h.in
217 ${srcdir}/stamp-h.in: configure.in aclocal.m4 acconfig.h # config.h.top config.h.bot
218 cd ${srcdir} # && autoheader
219 echo timestamp> ${srcdir}/stamp-h.in
222 stamp-h: config.h.in config.status
225 Makefile: Makefile.in config.status
228 config.status: configure
229 ./config.status --recheck
231 # This tells versions [3.59,3.63) of GNU make not to export all variables.
234 # Special dependencies, not easily handled portably without explicit rules
235 rcfile_l.c rcfile_l.h: $(srcdir)/rcfile_l.l
236 $(LEX) $(LEXFLAGS) $(srcdir)/rcfile_l.l
237 sed <lex.yy.c >rcfile_l.c -e "/lex\\.yy\\.c/s//rcfile_l.c/"
238 rcfile_y.c rcfile_y.h: $(srcdir)/rcfile_y.y
239 @echo "expect conflicts: 2 shift/reduce"
240 $(YACC) $(YACCFLAGS) $(srcdir)/rcfile_y.y
241 mv y.tab.c rcfile_y.c
242 mv -f y.tab.h rcfile_y.h
244 # These must be explicit, because the .c files often don't exist at
245 # makefile build time.
246 rcfile_l.o: rcfile_y.c rcfile_y.h config.h fetchmail.h
247 rcfile_y.o: rcfile_y.c rcfile_y.h config.h fetchmail.h
249 parser = $(srcdir)/rcfile_l.l $(srcdir)/rcfile_y.y
250 headers = $(srcdir)/fetchmail.h $(srcdir)/socket.h $(srcdir)/smtp.h \
251 $(srcdir)/mx.h $(srcdir)/md5.h $(srcdir)/md5global.h \
252 $(srcdir)/netrc.h $(srcdir)/tunable.h $(srcdir)/i18n.h \
253 $(srcdir)/aclocal.m4 $(srcdir)/ntlm.h $(srcdir)/smb.h \
254 $(srcdir)/smbbyteorder.h $(srcdir)/smbdes.h $(srcdir)/smbencrypt.h \
256 extra = $(srcdir)/alloca.c $(srcdir)/getopt.[ch] $(srcdir)/getopt1.c \
257 $(srcdir)/strcasecmp.c $(srcdir)/strstr.c $(srcdir)/memmove.c \
259 docs = $(srcdir)/COPYING $(srcdir)/FEATURES $(srcdir)/fetchmail-features.html \
260 $(srcdir)/design-notes.html $(srcdir)/NOTES \
261 $(srcdir)/todo.html $(srcdir)/TODO \
262 $(srcdir)/INSTALL $(srcdir)/NEWS $(srcdir)/README \
263 $(srcdir)/README.NTLM $(srcdir)/fetchmail.lsm \
264 $(srcdir)/*.man $(srcdir)/FAQ $(srcdir)/fetchmail-FAQ.html
265 config = $(srcdir)/Makefile.in $(srcdir)/configure.in $(srcdir)/configure \
266 $(srcdir)/config.guess $(srcdir)/config.h.in $(srcdir)/config.sub \
268 scripts = $(srcdir)/install.sh $(srcdir)/mkinstalldirs \
269 $(srcdir)/specgen.sh $(srcdir)/lsmgen.sh $(srcdir)/fetchmailconf
270 all = $(docs) $(config) $(srcs) $(parser) $(headers) $(extra) $(scripts) \
271 $(srcdir)/rh-config/* $(srcdir)/debian/* $(srcdir)/contrib/*[A-Za-uw-z] \
272 $(srcdir)/intl/* $(srcdir)/po/* $(srcdir)/beos/* ABOUT-NLS \
275 MANIFEST: $(srcdir) Makefile.in
276 @echo $(all) | tr "[ \t]" '\n' | sed -e '/^\.\//s///' | sort >MANIFEST
279 distdocs: FAQ FEATURES NOTES fetchmail-man.html
281 FAQ: fetchmail-FAQ.html
282 echo " (This document was generated from fetchmail-FAQ.html)" >FAQ
283 lynx -dump -nolist fetchmail-FAQ.html >>FAQ
285 FEATURES: fetchmail-features.html
286 echo " (This document was generated from fetchmail-features.html)" >FEATURES
287 lynx -dump -nolist fetchmail-features.html | grep -v "Back to " >>FEATURES
289 NOTES: design-notes.html
290 echo " (This document was generated from design-notes.html)" >NOTES
291 lynx -dump -nolist design-notes.html | grep -v "Back to " >>NOTES
294 echo " (This document was generated from todo.html)" >TODO
295 lynx -dump -nolist todo.html | grep -v "Back to " >>TODO
297 # man2html no longer chokes and dies on this man page,
298 # but manServer.pl does a much better job.
299 fetchmail-man.html: fetchmail.man
300 manServer.pl fetchmail.man >fetchmail-man.html
302 # Make distribution, update LSM with proper size, remake distribution
303 # (Making fetchmail-man.html is a kluge to ensure that it will be
304 # available when I upload the distribution.)
305 dist: Makefile.in distdocs
306 rm -f MANIFEST; make MANIFEST;
308 make fetchmail-$(VERSION).tar.gz
309 lsmgen.sh $(VERSION) `wc -c fetchmail-$(VERSION).tar.gz` >fetchmail.lsm
310 make fetchmail-$(VERSION).tar.gz
311 ls -l fetchmail-$(VERSION).tar.gz
312 @echo "Don't forget to build RPMs from root!"
314 fetchmail-$(VERSION).tar.gz: $(all)
315 (cd ..; ln -sf fetchmail fetchmail-$(VERSION))
316 (cd ..; tar -czf fetchmail-$(VERSION).tar.gz `sed <fetchmail-$(VERSION)/MANIFEST s:^:fetchmail-$(VERSION)/:`)
317 mv -f ../fetchmail-$(VERSION).tar.gz .
318 rm ../fetchmail-$(VERSION)
320 # Make RPMs. You need to be root to make this work
321 RPMROOT=/usr/src/redhat
325 cp fetchmail-$(VERSION).tar.gz fetchmail.xpm $(RPMROOT)/SOURCES;
326 $(srcdir)/specgen.sh $(VERSION) >$(RPMROOT)/SPECS/fetchmail.spec
327 cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) fetchmail.spec
328 cp $(RPMROOT)/RPMS/`arch|sed 's/i[4-9]86/i386/'`/fetchmail*-$(VERSION)*.rpm $(srcdir)
329 cp $(RPMROOT)/SRPMS/fetchmail*-$(VERSION)*.src.rpm $(srcdir)
331 # The following sets edit modes for GNU EMACS.
333 # compile-command:"configure"
336 # Automatically generated dependencies will be put at the end of the makefile.