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 # 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
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 # Number to put on the man page filename.
66 # Directory to install the man page in.
67 mandir = @mandir@/man$(manext)
69 # Program to install `make'.
70 INSTALL_PROGRAM = @INSTALL_PROGRAM@
71 # Program to install the man page.
72 INSTALL_DATA = @INSTALL_DATA@
73 # Generic install program.
76 # Program to format Texinfo source into Info files.
78 # Program to format Texinfo source into DVI files.
81 # Programs to make tags files.
85 protobjs = rcfile_y.o rcfile_l.o socket.o getpass.o pop2.o pop3.o imap.o \
86 etrn.o fetchmail.o env.o options.o daemon.o driver.o sink.o \
87 rfc822.o smtp.o xmalloc.o uid.o mxget.o md5c.o md5ify.o rpa.o \
88 interface.o netrc.o base64.o error.o unmime.o conf.o checkalias.o
90 objs = $(protobjs) $(extras) $(EXTRAOBJ)
92 srcs = $(srcdir)/socket.c $(srcdir)/getpass.c $(srcdir)/pop2.c \
93 $(srcdir)/pop3.c $(srcdir)/imap.c $(srcdir)/etrn.c \
94 $(srcdir)/fetchmail.c $(srcdir)/env.c \
95 $(srcdir)/options.c $(srcdir)/daemon.c $(srcdir)/driver.c \
96 $(srcdir)/sink.c $(srcdir)/rfc822.c $(srcdir)/smtp.c \
97 $(srcdir)/xmalloc.c $(srcdir)/uid.c $(srcdir)/mxget.c \
98 $(srcdir)/md5c.c $(srcdir)/md5ify.c $(srcdir)/rpa.c \
99 $(srcdir)/interface.c $(srcdir)/netrc.c $(srcdir)/base64.c \
100 $(srcdir)/error.c $(srcdir)/unmime.c $(srcdir)/conf.c \
101 $(srcdir)/checkalias.c
104 .SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi
108 # Some makes apparently use .PHONY as the default goal if it is before `all'.
112 $(CC) $(LDEFLAGS) $(LDFLAGS) $(objs) $(LOADLIBS) -o fetchmail
119 # Tester for address parsing
121 gcc -DTESTMAIN -g rfc822.c -o rfc822
123 # Stand-alone MIME decoder
124 unmime: unmime.c base64.c rfc822.c xmalloc.c error.c
125 $(CC) -DSTANDALONE -DHAVE_CONFIG_H -I. -g -o $@ $^
128 $(CC) $(defines) -c $(CPFLAGS) -I$(srcdir) -I. $(CEFLAGS) $(CFLAGS) $<
130 # For some losing Unix makes.
134 tagsrcs = $(srcs) rcfile_l.c rcfile_y.c
140 .PHONY: install uninstall
142 @echo "Creating installation directories..."
143 $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(mandir)
144 @echo "Installing fetchmail binary..."
145 $(INSTALL_PROGRAM) ./fetchmail $(bindir)/fetchmail
146 @echo "Installing fetchmail configurator..."
147 $(INSTALL_PROGRAM) ${srcdir}/fetchmailconf $(bindir)/fetchmailconf
148 @echo "Installing manual page..."
149 $(INSTALL_DATA) $(srcdir)/fetchmail.man $(mandir)/fetchmail.$(manext)
150 rm -f $(mandir)/fetchmailconf.$(manext)
151 ln -s $(mandir)/fetchmail.$(manext) $(mandir)/fetchmailconf.$(manext)
152 @echo "Installing language catalogs..."
156 rm -f $(bindir)/fetchmail $(bindir)/fetchmailconf
157 rm -f $(mandir)/fetchmail.$(manext) $(mandir)/fetchmailconf.$(manext)
160 .PHONY: clean realclean distclean mostlyclean
163 -rm -f fetchmail *.o core fetchmail.dvi \
164 rcfile_l.c rcfile_y.h rcfile_y.c \
165 fetchmail.tar fetchmail.tar.gz \
170 -rm -f Makefile config.h TAGS tags
171 -rm -f config.cache config.status config.log stamp-config
175 -rm -f FAQ FEATURES NOTES MANIFEST
176 -rm -f config.cache config.log Makefile
177 -rm -f fetchmail-*.tar.gz fetchmail-*.i386.rpm
181 config.status: configure Makefile.in
184 config.h: config.status config.h.in
185 sh config.status; touch config.h
187 Makefile: config.status
190 configure: configure.in
193 config.h.in: acconfig.h configure.in
194 autoheader $(ACFLAGS); touch config.h.in
196 # This tells versions [3.59,3.63) of GNU make not to export all variables.
199 # Special dependencies, not easily handled portably without explicit rules
200 rcfile_l.c rcfile_l.h: $(srcdir)/rcfile_l.l
201 $(LEX) $(LEXFLAGS) $(srcdir)/rcfile_l.l
202 mv lex.yy.c rcfile_l.c
203 rcfile_y.c rcfile_y.h: $(srcdir)/rcfile_y.y
204 @echo "expect conflicts: 2 shift/reduce"
205 $(YACC) $(YACCFLAGS) $(srcdir)/rcfile_y.y
206 mv y.tab.c rcfile_y.c
207 mv -f y.tab.h rcfile_y.h
209 # These must be explicit, because the .c files often don't exist at
210 # makefile build time.
211 rcfile_l.o: rcfile_y.c rcfile_y.h config.h fetchmail.h
212 rcfile_y.o: rcfile_y.c rcfile_y.h config.h fetchmail.h
214 parser = $(srcdir)/rcfile_l.l $(srcdir)/rcfile_y.y
215 headers = $(srcdir)/fetchmail.h $(srcdir)/socket.h $(srcdir)/smtp.h \
216 $(srcdir)/mx.h $(srcdir)/md5.h $(srcdir)/md5global.h \
217 $(srcdir)/netrc.h $(srcdir)/tunable.h $(srcdir)/i18n.h \
219 extra = $(srcdir)/alloca.c $(srcdir)/getopt.[ch] $(srcdir)/getopt1.c \
220 $(srcdir)/strcasecmp.c $(srcdir)/strstr.c $(srcdir)/memmove.c
221 docs = $(srcdir)/COPYING $(srcdir)/FEATURES $(srcdir)/fetchmail-features.html \
222 $(srcdir)/design-notes.html $(srcdir)/NOTES \
223 $(srcdir)/INSTALL $(srcdir)/NEWS $(srcdir)/README \
224 $(srcdir)/fetchmail.lsm $(srcdir)/sample.rcfile \
225 $(srcdir)/*.man $(srcdir)/FAQ $(srcdir)/fetchmail-FAQ.html
226 config = $(srcdir)/Makefile.in $(srcdir)/configure.in $(srcdir)/configure \
227 $(srcdir)/config.guess $(srcdir)/config.h.in $(srcdir)/config.sub \
229 scripts = $(srcdir)/install.sh $(srcdir)/mkinstalldirs \
230 $(srcdir)/specgen.sh $(srcdir)/lsmgen.sh $(srcdir)/fetchmailconf
231 all = $(docs) $(config) $(srcs) $(parser) $(headers) $(extra) $(scripts) \
232 $(srcdir)/rh-config/* $(srcdir)/debian/* $(srcdir)/contrib/*[A-Za-uw-z] \
233 $(srcdir)/intl/* $(srcdir)/po/* ABOUT-NLS $(srcdir)/MANIFEST
235 MANIFEST: $(srcdir) Makefile.in
236 @echo $(all) | tr "[ \t]" '\n' | sed -e '/^\.\//s///' | sort >MANIFEST
239 FAQ: fetchmail-FAQ.html
240 echo " (This document was generated from fetchmail-FAQ.html)" >FAQ
241 lynx -dump -nolist fetchmail-FAQ.html >>FAQ
243 FEATURES: fetchmail-features.html
244 echo " (This document was generated from fetchmail-features.html)" >FEATURES
245 lynx -dump -nolist fetchmail-features.html | grep -v "Back to " >>FEATURES
247 NOTES: design-notes.html
248 echo " (This document was generated from design-notes.html)" >NOTES
249 lynx -dump -nolist design-notes.html | grep -v "Back to " >NOTES
251 # Make distribution, update LSM with proper size, remake distribution
253 rm -f MANIFEST; make MANIFEST;
255 make fetchmail-$(VERSION).tar.gz
256 lsmgen.sh $(VERSION) `wc -c fetchmail-$(VERSION).tar.gz` >fetchmail.lsm
257 make fetchmail-$(VERSION).tar.gz
258 ls -l fetchmail-$(VERSION).tar.gz
259 @echo "Don't forget to build RPMs from root!"
261 fetchmail-$(VERSION).tar.gz: $(all)
262 (cd ..; ln -sf fetchmail fetchmail-$(VERSION))
263 (cd ..; tar -czf fetchmail-$(VERSION).tar.gz `sed <fetchmail-$(VERSION)/MANIFEST s:^:fetchmail-$(VERSION)/:`)
264 mv -f ../fetchmail-$(VERSION).tar.gz .
265 rm ../fetchmail-$(VERSION)
267 # Make RPMs. You need to be root to make this work
268 RPMROOT=/usr/src/redhat
272 cp fetchmail-$(VERSION).tar.gz fetchmail.gif $(RPMROOT)/SOURCES;
273 $(srcdir)/specgen.sh $(VERSION) >$(RPMROOT)/SPECS/fetchmail.spec
274 cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) fetchmail.spec
275 cp $(RPMROOT)/RPMS/`arch|sed 's/i[4-9]86/i386/'`/fetchmail-$(VERSION)*.rpm $(srcdir)
276 cp $(RPMROOT)/SRPMS/fetchmail-$(VERSION)*.src.rpm $(srcdir)
278 # The following sets edit modes for GNU EMACS.
280 # compile-command:"configure"
283 # Automatically generated dependencies will be put at the end of the makefile.