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.
8 # Ultrix 2.2 make doesn't expand the value of VPATH.
16 # CFLAGS = -g2 -5 # QNX
18 # LDLAGS = -g2 -5 # QNX
28 # How to invoke ranlib. This is only used by the `glob' subdirectory.
31 # NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
32 # See also `config.h'.
33 DEFS = @DEFS@ @EXTRADEFS@
34 # DEFS = -DQNX -DHAVE_CONFIG_H -DHAVE_UNISTD_H -DHAVE_STDARG_H -DSTDC_HEADERS # QNX
35 defines = -DRELEASE_ID=\"$(VERS)\" $(DEFS)
37 # If your system needs extra libraries loaded in, define them here.
38 # In particular, add -lresolv if you are running bind 4.9.5
39 LOADLIBS = @LIBS@ @LEXLIB@
40 # LOADLIBS = -lsocket3r -lunix3r # QNX
42 # Any extra object files your system needs.
45 # Extra sources/objects for library functions not provided on the host system.
47 # EXTRASRC = $(srcdir)/strcasecmp.c $(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/alloca.c # QNX
49 # EXTRAOBJ = strcasecmp.o getopt.o getopt1.o alloca.o
51 # Common prefix for machine-independent installed files.
53 # Common prefix for machine-dependent installed files.
54 exec_prefix = @exec_prefix@
56 # Directory in which to install.
58 # Directory to install the Info files in.
60 # Number to put on the man page filename.
62 # Directory to install the man page in.
63 mandir = @mandir@/man$(manext)
65 # Program to install `make'.
66 INSTALL_PROGRAM = @INSTALL_PROGRAM@
67 # Program to install the man page.
68 INSTALL_DATA = @INSTALL_DATA@
69 # Generic install program.
72 # Program to format Texinfo source into Info files.
74 # Program to format Texinfo source into DVI files.
77 # Programs to make tags files.
81 protobjs = rcfile_y.o rcfile_l.o socket.o getpass.o pop2.o pop3.o imap.o \
82 etrn.o fetchmail.o env.o options.o daemon.o driver.o rfc822.o smtp.o \
83 xmalloc.o uid.o mxget.o md5c.o md5ify.o rpa.o interface.o netrc.o \
84 base64.o error.o unmime.o conf.o
86 objs = $(protobjs) $(extras) $(EXTRAOBJ)
88 srcs = $(srcdir)/socket.c $(srcdir)/getpass.c $(srcdir)/pop2.c \
89 $(srcdir)/pop3.c $(srcdir)/imap.c $(srcdir)/etrn.c \
90 $(srcdir)/fetchmail.c $(srcdir)/env.c \
91 $(srcdir)/options.c $(srcdir)/daemon.c \
92 $(srcdir)/driver.c $(srcdir)/rfc822.c $(srcdir)/smtp.c \
93 $(srcdir)/xmalloc.c $(srcdir)/uid.c $(srcdir)/mxget.c \
94 $(srcdir)/md5c.c $(srcdir)/md5ify.c $(srcdir)/rpa.c \
95 $(srcdir)/interface.c $(srcdir)/netrc.c $(srcdir)/base64.c \
96 $(srcdir)/error.c $(srcdir)/unmime.c $(srcdir)/conf.c
99 .SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi
103 # Some makes apparently use .PHONY as the default goal if it is before `all'.
107 $(CC) $(LDEFLAGS) $(LDFLAGS) $(objs) $(LOADLIBS) -o fetchmail
109 # Tester for address parsing
111 gcc -DTESTMAIN -g rfc822.c -o rfc822
113 # Stand-alone MIME decoder
114 unmime: unmime.c base64.c rfc822.c xmalloc.c error.c memmove.c
115 $(CC) -DSTANDALONE -g -o $@ $^
118 $(CC) $(defines) -c -I$(srcdir) -I. $(CEFLAGS) $(CFLAGS) $<
120 # For some losing Unix makes.
124 tagsrcs = $(srcs) rcfile_l.c rcfile_y.c
130 .PHONY: install uninstall
132 @echo "Creating installation directories..."
133 $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(mandir)
134 @echo "Installing fetchmail binary..."
135 $(INSTALL_PROGRAM) ./fetchmail $(bindir)/fetchmail
136 @echo "Installing fetchmail configurator..."
137 $(INSTALL_PROGRAM) ${srcdir}/fetchmailconf $(bindir)/fetchmailconf
138 @echo "Installing manual page..."
139 $(INSTALL_DATA) $(srcdir)/fetchmail.man $(mandir)/fetchmail.$(manext)
140 ln -sf $(mandir)/fetchmail.$(manext) $(mandir)/fetchmailconf.$(manext)
143 rm -f $(bindir)/fetchmail $(bindir)/fetchmailconf
144 rm -f $(mandir)/fetchmail.$(manext) $(mandir)/fetchmailconf.$(manext)
146 .PHONY: clean realclean distclean mostlyclean
148 -rm -f fetchmail *.o core fetchmail.dvi \
149 rcfile_l.c rcfile_y.h rcfile_y.c \
150 fetchmail.tar fetchmail.tar.gz \
154 -rm -f Makefile config.h TAGS tags
155 -rm -f config.cache config.status config.log stamp-config
158 -rm -f FAQ FEATURES NOTES MANIFEST
159 -rm -f config.cache config.log Makefile
160 -rm -f fetchmail-*.tar.gz fetchmail-*.rpm
164 config.status: configure
167 config.h: config.status config.h.in
168 sh config.status; touch config.h
170 Makefile: config.status Makefile.in
173 configure: configure.in
176 config.h.in: acconfig.h configure.in
177 autoheader $(ACFLAGS); touch config.h.in
179 # This tells versions [3.59,3.63) of GNU make not to export all variables.
182 # Special dependencies, not easily handled portably without explicit rules
183 rcfile_l.c rcfile_l.h: $(srcdir)/rcfile_l.l
184 $(LEX) $(LEXFLAGS) $(srcdir)/rcfile_l.l
185 mv lex.yy.c rcfile_l.c
186 rcfile_y.c rcfile_y.h: $(srcdir)/rcfile_y.y
187 @echo "expect conflicts: 2 shift/reduce"
188 $(YACC) $(YACCFLAGS) $(srcdir)/rcfile_y.y
189 mv y.tab.c rcfile_y.c
190 mv -f y.tab.h rcfile_y.h
192 # These must be explicit, because the .c files often don't exist at
193 # makefile build time.
194 rcfile_l.o: rcfile_y.c rcfile_y.h config.h fetchmail.h
195 rcfile_y.o: rcfile_y.c rcfile_y.h config.h fetchmail.h
197 parser = $(srcdir)/rcfile_l.l $(srcdir)/rcfile_y.y
198 headers = $(srcdir)/fetchmail.h $(srcdir)/socket.h $(srcdir)/smtp.h \
199 $(srcdir)/mx.h $(srcdir)/md5.h $(srcdir)/md5global.h \
200 $(srcdir)/netrc.h $(srcdir)/tunable.h
201 extra = $(srcdir)/alloca.c $(srcdir)/getopt.[ch] $(srcdir)/getopt1.c \
202 $(srcdir)/strcasecmp.c $(srcdir)/strstr.c $(srcdir)/memmove.c
203 docs = $(srcdir)/COPYING $(srcdir)/FEATURES $(srcdir)/fetchmail-features.html \
204 $(srcdir)/design-notes.html $(srcdir)/NOTES \
205 $(srcdir)/INSTALL $(srcdir)/NEWS $(srcdir)/README \
206 $(srcdir)/fetchmail.lsm $(srcdir)/sample.rcfile \
207 $(srcdir)/*.man $(srcdir)/FAQ $(srcdir)/fetchmail-FAQ.html
208 config = $(srcdir)/Makefile.in $(srcdir)/configure.in $(srcdir)/configure \
209 $(srcdir)/config.guess $(srcdir)/config.h.in $(srcdir)/config.sub \
211 scripts = $(srcdir)/install.sh $(srcdir)/mkinstalldirs \
212 $(srcdir)/specgen.sh $(srcdir)/lsmgen.sh $(srcdir)/fetchmailconf
213 all = $(docs) $(config) $(srcs) $(parser) $(headers) $(extra) $(scripts) \
214 $(srcdir)/contrib/*[A-Za-uw-z] $(srcdir)/MANIFEST
216 MANIFEST: $(srcdir) Makefile.in
217 @echo $(all) | tr "[ \t]" '\n' | sed -e '/^\.\//s///' | sort >MANIFEST
220 FAQ: fetchmail-FAQ.html
221 echo " (This document was generated from fetchmail-FAQ.html)" >FAQ
222 lynx -dump -nolist fetchmail-FAQ.html >>FAQ
224 FEATURES: fetchmail-features.html
225 echo " (This document was generated from fetchmail-features.html)" >FEATURES
226 lynx -dump -nolist fetchmail-features.html | grep -v "Back to " >>FEATURES
228 NOTES: design-notes.html
229 echo " (This document was generated from design-notes.html)" >NOTES
230 lynx -dump -nolist design-notes.html | grep -v "Back to " >NOTES
232 # Make distribution, update LSM with proper size, remake distribution
234 rm -f MANIFEST; make MANIFEST;
236 make fetchmail-$(VERS).tar.gz
237 lsmgen.sh $(VERS) `wc -c fetchmail-$(VERS).tar.gz` >fetchmail.lsm
238 make fetchmail-$(VERS).tar.gz
239 ls -l fetchmail-$(VERS).tar.gz
240 @echo "Don't forget to build RPMs from root!"
242 # This requires my patch to tar-1.12, or a stock tar-1.13 (not yet released);
243 # the version must implement the --name-prefix option.
244 fetchmail-$(VERS).tar.gz: $(all)
245 tar --name-prefix='fetchmail-$(VERS)/' -czf fetchmail-$(VERS).tar.gz `cat MANIFEST`
247 # Make RPMs. You need to be root to make this work
248 RPMROOT=/usr/src/redhat
252 cp fetchmail-$(VERS).tar.gz fetchmail.gif $(RPMROOT)/SOURCES;
253 $(srcdir)/specgen.sh $(VERS) >$(RPMROOT)/SPECS/fetchmail.spec
254 cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) fetchmail.spec
255 cp $(RPMROOT)/RPMS/`arch|sed 's/i[4-9]86/i386/'`/fetchmail-$(VERS)*.rpm $(srcdir)
256 cp $(RPMROOT)/SRPMS/fetchmail-$(VERS)*.src.rpm $(srcdir)
258 # The following sets edit modes for GNU EMACS.
260 # compile-command:"configure"
263 # Automatically generated dependencies will be put at the end of the makefile.