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 SUBDIRS = @INTLSUB@ @POSUB@
11 # Ultrix 2.2 make doesn't expand the value of VPATH.
19 # CFLAGS = -g2 -5 # QNX
21 # LDFLAGS = -g2 -5 -N64k # QNX
32 # How to invoke ranlib. This is only used by the `glob' subdirectory.
35 # NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
36 # See also `config.h'.
37 DEFS = @DEFS@ @EXTRADEFS@
38 # DEFS = -DQNX -DHAVE_CONFIG_H -DHAVE_UNISTD_H -DHAVE_STDARG_H -DSTDC_HEADERS # QNX
41 # If your system needs extra libraries loaded in, define them here.
42 # In particular, add -lresolv if you are running bind 4.9.5
43 LOADLIBS = @LIBS@ @LEXLIB@ @INTLLIBS@
44 # LOADLIBS = -lsocket3r -lunix3r # QNX
46 # Any extra object files your system needs.
49 # Extra sources/objects for library functions not provided on the host system.
51 # EXTRASRC = $(srcdir)/strcasecmp.c $(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/alloca.c # QNX
53 # EXTRAOBJ = strcasecmp.o getopt.o getopt1.o alloca.o
57 # Common prefix for machine-independent installed files.
59 # Common prefix for machine-dependent installed files.
60 exec_prefix = @exec_prefix@
62 # Directory in which to install.
64 # Directory to install the Info files in.
66 # Number to put on the man page filename.
68 # Directory to install the man page in.
69 mandir = @mandir@/man$(manext)
71 # Program to install `make'.
72 INSTALL_PROGRAM = @INSTALL_PROGRAM@
73 # Program to install the man page.
74 INSTALL_DATA = @INSTALL_DATA@
75 # Generic install program.
78 # Program to format Texinfo source into Info files.
80 # Program to format Texinfo source into DVI files.
83 # Programs to make tags files.
87 protobjs = rcfile_y.o rcfile_l.o socket.o getpass.o pop2.o pop3.o imap.o \
88 etrn.o fetchmail.o idle.o env.o options.o daemon.o driver.o sink.o \
89 rfc822.o smtp.o xmalloc.o uid.o mxget.o md5ify.o rpa.o \
90 interface.o netrc.o base64.o error.o unmime.o conf.o checkalias.o \
91 smbdes.o smbencrypt.o smbmd4.o smbutil.o ipv6-connect.o
93 objs = $(protobjs) $(extras) $(EXTRAOBJ)
95 srcs = $(srcdir)/socket.c $(srcdir)/getpass.c $(srcdir)/pop2.c \
96 $(srcdir)/pop3.c $(srcdir)/imap.c $(srcdir)/etrn.c \
97 $(srcdir)/fetchmail.c $(srcdir)/env.c $(srcdir)/idle.c \
98 $(srcdir)/options.c $(srcdir)/daemon.c $(srcdir)/driver.c \
99 $(srcdir)/sink.c $(srcdir)/rfc822.c $(srcdir)/smtp.c \
100 $(srcdir)/xmalloc.c $(srcdir)/uid.c $(srcdir)/mxget.c \
101 $(srcdir)/md5ify.c $(srcdir)/rpa.c $(srcdir)/interface.c \
102 $(srcdir)/netrc.c $(srcdir)/base64.c $(srcdir)/error.c \
103 $(srcdir)/unmime.c $(srcdir)/conf.c $(srcdir)/checkalias.c \
104 $(srcdir)/smbdes.c $(srcdir)/smbencrypt.c $(srcdir)/smbmd4.c \
105 $(srcdir)/smbutil.c $(srcdir)/ipv6-connect.c
108 .SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi
112 # Some makes apparently use .PHONY as the default goal if it is before `all'.
116 $(CC) $(LDEFLAGS) $(LDFLAGS) $(objs) $(LOADLIBS) -o fetchmail
124 # Tester for address parsing
126 gcc -DTESTMAIN -g rfc822.c -o rfc822
128 # Stand-alone MIME decoder
129 unmime: unmime.c base64.c rfc822.c xmalloc.c error.c
130 $(CC) -DSTANDALONE -DHAVE_CONFIG_H -I. -g -o $@ $^
133 # Stand-alone netrc tester
134 netrc: netrc.c xmalloc.o error.o
135 $(CC) -DSTANDALONE -DHAVE_CONFIG_H -I. -g -o $@ $^
138 $(CC) $(defines) -c $(CPFLAGS) -I$(srcdir) -I. $(CEFLAGS) $(CFLAGS) $<
140 # For some losing Unix makes.
144 tagsrcs = $(srcs) rcfile_l.c rcfile_y.c
150 .PHONY: install uninstall
152 @echo "Creating installation directories..."
153 $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)
154 @echo "Installing fetchmail binary..."
155 $(INSTALL_PROGRAM) ./fetchmail $(DESTDIR)$(bindir)/fetchmail
156 @echo "Installing fetchmail configurator..."
157 $(INSTALL_PROGRAM) ${srcdir}/fetchmailconf $(DESTDIR)$(bindir)/fetchmailconf
158 @echo "Installing manual page..."
159 $(INSTALL_DATA) $(srcdir)/fetchmail.man $(DESTDIR)$(mandir)/fetchmail.$(manext)
160 rm -f $(DESTDIR)$(mandir)/fetchmailconf.$(manext)
161 cd $(DESTDIR)$(mandir) && ln -s fetchmail.$(manext) fetchmailconf.$(manext)
162 @echo "Installing language catalogs..."
166 rm -f $(DESTDIR)$(bindir)/fetchmail $(DESTDIR)$(bindir)/fetchmailconf
167 rm -f $(DESTDIR)$(mandir)/fetchmail.$(manext) $(DESTDIR)$(mandir)/fetchmailconf.$(manext)
170 .PHONY: clean realclean distclean mostlyclean
173 -rm -f fetchmail *.o core fetchmail.dvi \
174 rcfile_l.c rcfile_y.h rcfile_y.c \
175 fetchmail.tar fetchmail.tar.gz \
176 netrc rfc822 unmime fetchmail-man.html
180 -rm -f Makefile config.h TAGS tags
181 -rm -f config.cache config.status config.log stamp-config
185 -rm -f FAQ FEATURES NOTES MANIFEST
186 -rm -f config.cache config.log Makefile
187 -rm -f fetchmail-*.tar.gz fetchmail-*.i386.rpm
191 # These magic rules are copied from the autoconf documentation
192 # except that Harry McGavran says the autoheader call in the third
193 # one below is unnecessary and causes problems with cross-platform builds.
195 ${srcdir}/configure: configure.in aclocal.m4
196 cd ${srcdir} && autoconf
198 # autoheader might not change config.h.in, so touch a stamp file.
199 ${srcdir}/config.h.in: stamp-h.in
201 ${srcdir}/stamp-h.in: configure.in aclocal.m4 acconfig.h # config.h.top config.h.bot
202 cd ${srcdir} # && autoheader
203 echo timestamp> ${srcdir}/stamp-h.in
206 stamp-h: config.h.in config.status
209 Makefile: Makefile.in config.status
212 config.status: configure
213 ./config.status --recheck
215 # This tells versions [3.59,3.63) of GNU make not to export all variables.
218 # Special dependencies, not easily handled portably without explicit rules
219 rcfile_l.c rcfile_l.h: $(srcdir)/rcfile_l.l
220 $(LEX) $(LEXFLAGS) $(srcdir)/rcfile_l.l
221 mv lex.yy.c rcfile_l.c
222 rcfile_y.c rcfile_y.h: $(srcdir)/rcfile_y.y
223 @echo "expect conflicts: 2 shift/reduce"
224 $(YACC) $(YACCFLAGS) $(srcdir)/rcfile_y.y
225 mv y.tab.c rcfile_y.c
226 mv -f y.tab.h rcfile_y.h
228 # These must be explicit, because the .c files often don't exist at
229 # makefile build time.
230 rcfile_l.o: rcfile_y.c rcfile_y.h config.h fetchmail.h
231 rcfile_y.o: rcfile_y.c rcfile_y.h config.h fetchmail.h
233 parser = $(srcdir)/rcfile_l.l $(srcdir)/rcfile_y.y
234 headers = $(srcdir)/fetchmail.h $(srcdir)/socket.h $(srcdir)/smtp.h \
235 $(srcdir)/mx.h $(srcdir)/md5.h $(srcdir)/md5global.h \
236 $(srcdir)/netrc.h $(srcdir)/tunable.h $(srcdir)/i18n.h \
237 $(srcdir)/aclocal.m4 $(srcdir)/ntlm.h $(srcdir)/smb.h \
238 $(srcdir)/smbbyteorder.h $(srcdir)/smbdes.h $(srcdir)/smbencrypt.h \
240 extra = $(srcdir)/alloca.c $(srcdir)/getopt.[ch] $(srcdir)/getopt1.c \
241 $(srcdir)/strcasecmp.c $(srcdir)/strstr.c $(srcdir)/memmove.c \
243 docs = $(srcdir)/COPYING $(srcdir)/FEATURES $(srcdir)/fetchmail-features.html \
244 $(srcdir)/design-notes.html $(srcdir)/NOTES \
245 $(srcdir)/INSTALL $(srcdir)/NEWS $(srcdir)/TODO $(srcdir)/README \
246 $(srcdir)/README.NTLM $(srcdir)/fetchmail.lsm $(srcdir)/sample.rcfile \
247 $(srcdir)/*.man $(srcdir)/FAQ $(srcdir)/fetchmail-FAQ.html
248 config = $(srcdir)/Makefile.in $(srcdir)/configure.in $(srcdir)/configure \
249 $(srcdir)/config.guess $(srcdir)/config.h.in $(srcdir)/config.sub \
251 scripts = $(srcdir)/install.sh $(srcdir)/mkinstalldirs \
252 $(srcdir)/specgen.sh $(srcdir)/lsmgen.sh $(srcdir)/fetchmailconf
253 all = $(docs) $(config) $(srcs) $(parser) $(headers) $(extra) $(scripts) \
254 $(srcdir)/rh-config/* $(srcdir)/debian/* $(srcdir)/contrib/*[A-Za-uw-z] \
255 $(srcdir)/intl/* $(srcdir)/po/* $(srcdir)/beos/* ABOUT-NLS \
258 MANIFEST: $(srcdir) Makefile.in
259 @echo $(all) | tr "[ \t]" '\n' | sed -e '/^\.\//s///' | sort >MANIFEST
262 distdocs: FAQ FEATURES NOTES fetchmail-man.html
264 FAQ: fetchmail-FAQ.html
265 echo " (This document was generated from fetchmail-FAQ.html)" >FAQ
266 lynx -dump -nolist fetchmail-FAQ.html >>FAQ
268 FEATURES: fetchmail-features.html
269 echo " (This document was generated from fetchmail-features.html)" >FEATURES
270 lynx -dump -nolist fetchmail-features.html | grep -v "Back to " >>FEATURES
272 NOTES: design-notes.html
273 echo " (This document was generated from design-notes.html)" >NOTES
274 lynx -dump -nolist design-notes.html | grep -v "Back to " >NOTES
276 # man2html chokes and dies on this man page
277 fetchmail-man.html: fetchmail.man
278 echo "<pre>" >fetchmail-man.html
279 groff -t -man -Tascii -P-b -P-u fetchmail.man >>fetchmail-man.html
280 echo "</pre>" >>fetchmail-man.html
282 # Make distribution, update LSM with proper size, remake distribution
283 # (Making fetchmail-man.html is a kluge to ensure that it will be
284 # available when I upload the distribution.)
285 dist: Makefile.in distdocs
286 rm -f MANIFEST; make MANIFEST;
288 make fetchmail-$(VERSION).tar.gz
289 lsmgen.sh $(VERSION) `wc -c fetchmail-$(VERSION).tar.gz` >fetchmail.lsm
290 make fetchmail-$(VERSION).tar.gz
291 ls -l fetchmail-$(VERSION).tar.gz
292 @echo "Don't forget to build RPMs from root!"
294 fetchmail-$(VERSION).tar.gz: $(all)
295 (cd ..; ln -sf fetchmail fetchmail-$(VERSION))
296 (cd ..; tar -czf fetchmail-$(VERSION).tar.gz `sed <fetchmail-$(VERSION)/MANIFEST s:^:fetchmail-$(VERSION)/:`)
297 mv -f ../fetchmail-$(VERSION).tar.gz .
298 rm ../fetchmail-$(VERSION)
300 # Make RPMs. You need to be root to make this work
301 RPMROOT=/usr/src/redhat
305 cp fetchmail-$(VERSION).tar.gz fetchmail.xpm $(RPMROOT)/SOURCES;
306 $(srcdir)/specgen.sh $(VERSION) >$(RPMROOT)/SPECS/fetchmail.spec
307 cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) fetchmail.spec
308 cp $(RPMROOT)/RPMS/`arch|sed 's/i[4-9]86/i386/'`/fetchmail*-$(VERSION)*.rpm $(srcdir)
309 cp $(RPMROOT)/SRPMS/fetchmail*-$(VERSION)*.src.rpm $(srcdir)
311 # The following sets edit modes for GNU EMACS.
313 # compile-command:"configure"
316 # Automatically generated dependencies will be put at the end of the makefile.