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 # Ultrix 2.2 make doesn't expand the value of VPATH.
17 # CFLAGS = -g2 -5 # QNX
19 # LDLAGS = -g2 -5 # QNX
26 # How to invoke ranlib. This is only used by the `glob' subdirectory.
29 # NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
30 # See also `config.h'.
32 # DEFS = -DQNX -DHAVE_CONFIG_H -DHAVE_UNISTD_H -DHAVE_STDARG_H -DSTDC_HEADERS # QNX
33 defines = -DRELEASE_ID=\"$(VERS)\" -DPATCHLEVEL=\"$(PL)\" $(DEFS)
35 # If your system needs extra libraries loaded in, define them here.
36 LOADLIBS = @LIBS@ @LEXLIB@
37 # LOADLIBS = -lsocket3r -lunix3r # QNX
39 # Any extra object files your system needs.
42 # Extra sources/objects for library functions not provided on the host system.
44 # EXTRASRC = $(srcdir)/strcasecmp.c $(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/alloca.c # QNX
46 # EXTRAOBJ = strcasecmp.o getopt.o getopt1.o alloca.o
48 # Common prefix for machine-independent installed files.
50 # Common prefix for machine-dependent installed files.
51 exec_prefix = @exec_prefix@
53 # Name under which to install fetchmail
55 # Directory in which to install.
57 # Directory to install the Info files in.
59 # Number to put on the man page filename.
61 # Directory to install the man page in.
62 mandir = @mandir@/man$(manext)
64 # Program to install `make'.
65 INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s
66 # Program to install the man page.
67 INSTALL_DATA = @INSTALL_DATA@
68 # Generic install program.
71 # Program to format Texinfo source into Info files.
73 # Program to format Texinfo source into DVI files.
76 # Programs to make tags files.
80 protobjs = socket.o getpass.o pop2.o pop3.o imap.o etrn.o fetchmail.o \
81 options.o rcfile_y.o rcfile_l.o daemon.o smtp.o driver.o rfc822.o \
82 xmalloc.o uid.o mxget.o md5c.o md5ify.o interface.o netrc.o error.o
84 objs = $(protobjs) $(extras) $(EXTRAOBJ)
86 srcs = $(srcdir)/socket.c $(srcdir)/getpass.c $(srcdir)/pop2.c \
87 $(srcdir)/pop3.c $(srcdir)/imap.c $(srcdir)/etrn.c \
88 $(srcdir)/fetchmail.c $(srcdir)/options.c $(srcdir)/daemon.c \
89 $(srcdir)/driver.c $(srcdir)/rfc822.c $(srcdir)/smtp.c \
90 $(srcdir)/xmalloc.c $(srcdir)/uid.c $(srcdir)/mxget.c \
91 $(srcdir)/md5c.c $(srcdir)/md5ify.c $(srcdir)/interface.c \
92 $(srcdir)/netrc.c $(srcdir)/error.c
95 .SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi
99 # Some makes apparently use .PHONY as the default goal if it is before `all'.
103 $(CC) $(LDFLAGS) $(objs) $(LOADLIBS) -o fetchmail
105 # Tester for address parsing
107 gcc -DTESTMAIN -g rfc822.c -o rfc822
109 # -I. is needed to find config.h in the build directory.
111 $(CC) $(defines) -c -I. -I$(srcdir) $(CFLAGS) $< $(OUTPUT_OPTION)
117 $(LEX) $(LEXFLAGS) $<
124 $(YACC) $(YACCFLAGS) $<
128 # For some losing Unix makes.
134 tagsrcs = $(srcs) $(srcdir)/rcfile_l.c $(srcdir)/rcfile_y.c
140 .PHONY: install installdirs
141 install: installdirs $(bindir)/$(instname) $(mandir)/$(instname).$(manext)
144 $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(mandir)
146 $(bindir)/$(instname): fetchmail
147 $(INSTALL_PROGRAM) fetchmail $@
149 $(mandir)/$(instname).$(manext): fetchmail.man
150 $(INSTALL_DATA) $(srcdir)/fetchmail.man $@
152 .PHONY: clean realclean distclean mostlyclean
154 -rm -f fetchmail *.o core fetchmail.dvi \
155 rcfile_l.c rcfile_y.h rcfile_y.c \
156 fetchmail.tar fetchmail.tar.gz \
160 -rm -f Makefile config.h TAGS tags
161 -rm -f config.cache config.status config.log stamp-config
162 -rm -f fetchmail.log fetchmail.toc fetchmail.*aux
164 realclean: distclean # fetchmail.info*
168 Makefile: config.status $(srcdir)/Makefile.in
169 $(SHELL) config.status
170 @echo "You can ignore any makedepend error messages"
171 -makedepend -I. -fMakefile *.c
173 config.h: stamp-config
175 stamp-config: config.status $(srcdir)/config.h.in
176 $(SHELL) config.status
179 configure: configure.in
182 config.h.in: acconfig.h
183 autoheader $(ACFLAGS)
185 # This tells versions [3.59,3.63) of GNU make not to export all variables.
188 # Special dependencies, not easily handled without explicit rules
189 $(srcdir)/rcfile_l.c $(srcdir)/rcfile_l.h: $(srcdir)/rcfile_l.l
190 $(srcdir)/rcfile_y.c $(srcdir)/rcfile_y.h: $(srcdir)/rcfile_y.y
192 parser = $(srcdir)/rcfile_l.l $(srcdir)/rcfile_y.y
193 headers = $(srcdir)/fetchmail.h $(srcdir)/socket.h $(srcdir)/smtp.h \
194 $(srcdir)/mx.h $(srcdir)/md5.h $(srcdir)/md5global.h \
195 $(srcdir)/netrc.h $(srcdir)/tunable.h
196 extra = $(srcdir)/alloca.c $(srcdir)/getopt.[ch] $(srcdir)/getopt1.c \
197 $(srcdir)/strcasecmp.c
198 docs = $(srcdir)/COPYING $(srcdir)/README $(srcdir)/INSTALL $(srcdir)/NEWS \
199 $(srcdir)/NOTES $(srcdir)/fetchmail.lsm \
200 $(srcdir)/*.man $(srcdir)/sample.rcfile $(srcdir)/FAQ
201 config = $(srcdir)/Makefile.in $(srcdir)/configure.in $(srcdir)/configure \
202 $(srcdir)/config.guess $(srcdir)/config.h.in $(srcdir)/config.sub \
204 scripts = $(srcdir)/install.sh $(srcdir)/mkinstalldirs $(srcdir)/specgen.sh
205 all = $(docs) $(config) $(srcs) $(parser) $(headers) $(extra) $(scripts) \
209 @echo $(all) | tr "[ \t]" '\n' | sort | sed "s/\\./fetchmail-$(VERS)/" >MANIFEST
211 dist: fetchmail-$(VERS).tar.gz
212 ls -l fetchmail-$(VERS).tar.gz
214 fetchmail-$(VERS).tar: $(all)
215 (cd ..; tar -cf fetchmail-$(VERS).tar `cat fetchmail-$(VERS)/MANIFEST`)
216 mv ../fetchmail-$(VERS).tar fetchmail-$(VERS).tar
217 fetchmail-$(VERS).tar.gz: fetchmail-$(VERS).tar
218 gzip -f fetchmail-$(VERS).tar
220 RPMROOT=/usr/src/redhat
223 rpm: fetchmail-$(VERS).tar.gz
224 cp fetchmail-$(VERS).tar.gz $(RPMROOT)/SOURCES;
225 $(srcdir)/specgen.sh $(VERS) $(PL) >$(RPMROOT)/SPECS/fetchmail.spec
226 cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) fetchmail.spec
228 # The automatically generated dependencies below may omit config.h
229 # because it is included with ``#include <config.h>'' rather than
230 # ``#include "config.h"''. So we add the explicit dependency to make sure.
233 rcfile_l.o: rcfile_y.h
235 # Automatically generated dependencies will be put at the end of the makefile.
236 # DO NOT DELETE THIS LINE -- make depend depends on it.