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
29 # How to invoke ranlib. This is only used by the `glob' subdirectory.
32 # NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
33 # See also `config.h'.
34 DEFS = @DEFS@ @EXTRADEFS@
35 # DEFS = -DQNX -DHAVE_CONFIG_H -DHAVE_UNISTD_H -DHAVE_STDARG_H -DSTDC_HEADERS # QNX
36 defines = -DRELEASE_ID=\"$(VERS)\" $(DEFS)
38 # If your system needs extra libraries loaded in, define them here.
39 # In particular, add -lresolv if you are running bind 4.9.5
40 LOADLIBS = @LIBS@ @LEXLIB@
41 # LOADLIBS = -lsocket3r -lunix3r # QNX
43 # Any extra object files your system needs.
46 # Extra sources/objects for library functions not provided on the host system.
48 # EXTRASRC = $(srcdir)/strcasecmp.c $(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/alloca.c # QNX
50 # EXTRAOBJ = strcasecmp.o getopt.o getopt1.o alloca.o
52 # Common prefix for machine-independent installed files.
54 # Common prefix for machine-dependent installed files.
55 exec_prefix = @exec_prefix@
57 # Directory in which to install.
59 # Directory to install the Info files in.
61 # Number to put on the man page filename.
63 # Directory to install the man page in.
64 mandir = @mandir@/man$(manext)
66 # Program to install `make'.
67 INSTALL_PROGRAM = @INSTALL_PROGRAM@
68 # Program to install the man page.
69 INSTALL_DATA = @INSTALL_DATA@
70 # Generic install program.
73 # Program to format Texinfo source into Info files.
75 # Program to format Texinfo source into DVI files.
78 # Programs to make tags files.
82 protobjs = rcfile_y.o rcfile_l.o socket.o getpass.o pop2.o pop3.o imap.o \
83 etrn.o fetchmail.o env.o options.o daemon.o driver.o sink.o \
84 rfc822.o smtp.o xmalloc.o uid.o mxget.o md5c.o md5ify.o rpa.o \
85 interface.o netrc.o base64.o error.o unmime.o conf.o checkalias.o
87 objs = $(protobjs) $(extras) $(EXTRAOBJ)
89 srcs = $(srcdir)/socket.c $(srcdir)/getpass.c $(srcdir)/pop2.c \
90 $(srcdir)/pop3.c $(srcdir)/imap.c $(srcdir)/etrn.c \
91 $(srcdir)/fetchmail.c $(srcdir)/env.c \
92 $(srcdir)/options.c $(srcdir)/daemon.c $(srcdir)/driver.c \
93 $(srcdir)/sink.c $(srcdir)/rfc822.c $(srcdir)/smtp.c \
94 $(srcdir)/xmalloc.c $(srcdir)/uid.c $(srcdir)/mxget.c \
95 $(srcdir)/md5c.c $(srcdir)/md5ify.c $(srcdir)/rpa.c \
96 $(srcdir)/interface.c $(srcdir)/netrc.c $(srcdir)/base64.c \
97 $(srcdir)/error.c $(srcdir)/unmime.c $(srcdir)/conf.c \
98 $(srcdir)/checkalias.c
101 .SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi
105 # Some makes apparently use .PHONY as the default goal if it is before `all'.
109 $(CC) $(LDEFLAGS) $(LDFLAGS) $(objs) $(LOADLIBS) -o fetchmail
111 # Tester for address parsing
113 gcc -DTESTMAIN -g rfc822.c -o rfc822
115 # Stand-alone MIME decoder
116 unmime: unmime.c base64.c rfc822.c xmalloc.c error.c memmove.c
117 $(CC) -DSTANDALONE -g -o $@ $^
120 $(CC) $(defines) -c $(CPFLAGS) -I$(srcdir) -I. $(CEFLAGS) $(CFLAGS) $<
122 # For some losing Unix makes.
126 tagsrcs = $(srcs) rcfile_l.c rcfile_y.c
132 .PHONY: install uninstall
134 @echo "Creating installation directories..."
135 $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(mandir)
136 @echo "Installing fetchmail binary..."
137 $(INSTALL_PROGRAM) ./fetchmail $(bindir)/fetchmail
138 @echo "Installing fetchmail configurator..."
139 $(INSTALL_PROGRAM) ${srcdir}/fetchmailconf $(bindir)/fetchmailconf
140 @echo "Installing manual page..."
141 $(INSTALL_DATA) $(srcdir)/fetchmail.man $(mandir)/fetchmail.$(manext)
142 ln -f -s $(mandir)/fetchmail.$(manext) $(mandir)/fetchmailconf.$(manext)
145 rm -f $(bindir)/fetchmail $(bindir)/fetchmailconf
146 rm -f $(mandir)/fetchmail.$(manext) $(mandir)/fetchmailconf.$(manext)
148 .PHONY: clean realclean distclean mostlyclean
150 -rm -f fetchmail *.o core fetchmail.dvi \
151 rcfile_l.c rcfile_y.h rcfile_y.c \
152 fetchmail.tar fetchmail.tar.gz \
156 -rm -f Makefile config.h TAGS tags
157 -rm -f config.cache config.status config.log stamp-config
160 -rm -f FAQ FEATURES NOTES MANIFEST
161 -rm -f config.cache config.log Makefile
162 -rm -f fetchmail-*.tar.gz fetchmail-*.i386.rpm
166 config.status: configure
169 config.h: config.status config.h.in
170 sh config.status; touch config.h
172 Makefile: config.status Makefile.in
175 configure: configure.in
178 config.h.in: acconfig.h configure.in
179 autoheader $(ACFLAGS); touch config.h.in
181 # This tells versions [3.59,3.63) of GNU make not to export all variables.
184 # Special dependencies, not easily handled portably without explicit rules
185 rcfile_l.c rcfile_l.h: $(srcdir)/rcfile_l.l
186 $(LEX) $(LEXFLAGS) $(srcdir)/rcfile_l.l
187 mv lex.yy.c rcfile_l.c
188 rcfile_y.c rcfile_y.h: $(srcdir)/rcfile_y.y
189 @echo "expect conflicts: 2 shift/reduce"
190 $(YACC) $(YACCFLAGS) $(srcdir)/rcfile_y.y
191 mv y.tab.c rcfile_y.c
192 mv -f y.tab.h rcfile_y.h
194 # These must be explicit, because the .c files often don't exist at
195 # makefile build time.
196 rcfile_l.o: rcfile_y.c rcfile_y.h config.h fetchmail.h
197 rcfile_y.o: rcfile_y.c rcfile_y.h config.h fetchmail.h
199 parser = $(srcdir)/rcfile_l.l $(srcdir)/rcfile_y.y
200 headers = $(srcdir)/fetchmail.h $(srcdir)/socket.h $(srcdir)/smtp.h \
201 $(srcdir)/mx.h $(srcdir)/md5.h $(srcdir)/md5global.h \
202 $(srcdir)/netrc.h $(srcdir)/tunable.h
203 extra = $(srcdir)/alloca.c $(srcdir)/getopt.[ch] $(srcdir)/getopt1.c \
204 $(srcdir)/strcasecmp.c $(srcdir)/strstr.c $(srcdir)/memmove.c
205 docs = $(srcdir)/COPYING $(srcdir)/FEATURES $(srcdir)/fetchmail-features.html \
206 $(srcdir)/design-notes.html $(srcdir)/NOTES \
207 $(srcdir)/INSTALL $(srcdir)/NEWS $(srcdir)/README \
208 $(srcdir)/fetchmail.lsm $(srcdir)/sample.rcfile \
209 $(srcdir)/*.man $(srcdir)/FAQ $(srcdir)/fetchmail-FAQ.html
210 config = $(srcdir)/Makefile.in $(srcdir)/configure.in $(srcdir)/configure \
211 $(srcdir)/config.guess $(srcdir)/config.h.in $(srcdir)/config.sub \
213 scripts = $(srcdir)/install.sh $(srcdir)/mkinstalldirs \
214 $(srcdir)/specgen.sh $(srcdir)/lsmgen.sh $(srcdir)/fetchmailconf
215 all = $(docs) $(config) $(srcs) $(parser) $(headers) $(extra) $(scripts) \
216 $(srcdir)/rh-config/* $(srcdir)/contrib/*[A-Za-uw-z] $(srcdir)/MANIFEST
218 MANIFEST: $(srcdir) Makefile.in
219 @echo $(all) | tr "[ \t]" '\n' | sed -e '/^\.\//s///' | sort >MANIFEST
222 FAQ: fetchmail-FAQ.html
223 echo " (This document was generated from fetchmail-FAQ.html)" >FAQ
224 lynx -dump -nolist fetchmail-FAQ.html >>FAQ
226 FEATURES: fetchmail-features.html
227 echo " (This document was generated from fetchmail-features.html)" >FEATURES
228 lynx -dump -nolist fetchmail-features.html | grep -v "Back to " >>FEATURES
230 NOTES: design-notes.html
231 echo " (This document was generated from design-notes.html)" >NOTES
232 lynx -dump -nolist design-notes.html | grep -v "Back to " >NOTES
234 # Make distribution, update LSM with proper size, remake distribution
236 rm -f MANIFEST; make MANIFEST;
238 make fetchmail-$(VERS).tar.gz
239 lsmgen.sh $(VERS) `wc -c fetchmail-$(VERS).tar.gz` >fetchmail.lsm
240 make fetchmail-$(VERS).tar.gz
241 ls -l fetchmail-$(VERS).tar.gz
242 @echo "Don't forget to build RPMs from root!"
244 fetchmail-$(VERS).tar.gz: $(all)
245 (cd ..; ln -sf fetchmail fetchmail-$(VERS))
246 (cd ..; tar -czf fetchmail-$(VERS).tar.gz `sed <fetchmail-$(VERS)/MANIFEST s:^:fetchmail-$(VERS)/:`)
247 mv -f ../fetchmail-$(VERS).tar.gz .
248 rm ../fetchmail-$(VERS)
250 # Make RPMs. You need to be root to make this work
251 RPMROOT=/usr/src/redhat
255 cp fetchmail-$(VERS).tar.gz fetchmail.gif $(RPMROOT)/SOURCES;
256 $(srcdir)/specgen.sh $(VERS) >$(RPMROOT)/SPECS/fetchmail.spec
257 cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) fetchmail.spec
258 cp $(RPMROOT)/RPMS/`arch|sed 's/i[4-9]86/i386/'`/fetchmail-$(VERS)*.rpm $(srcdir)
259 cp $(RPMROOT)/SRPMS/fetchmail-$(VERS)*.src.rpm $(srcdir)
261 # The following sets edit modes for GNU EMACS.
263 # compile-command:"configure"
266 # Automatically generated dependencies will be put at the end of the makefile.