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 # EXTRAOBJS = 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 fetchmail.o options.o \
81 rcfile_l.o rcfile_y.o daemon.o smtp.o driver.o rfc822.o xmalloc.o \
82 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)/fetchmail.c \
88 $(srcdir)/options.c $(srcdir)/daemon.c $(srcdir)/driver.c \
89 $(srcdir)/rfc822.c $(srcdir)/smtp.c $(srcdir)/xmalloc.c \
90 $(srcdir)/uid.c $(srcdir)/mxget.c $(srcdir)/md5c.c \
91 $(srcdir)/md5ify.c $(srcdir)/interface.c $(srcdir)/netrc.c \
95 .SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi
97 all: fetchmail fetchmail.spec
99 # Some makes apparently use .PHONY as the default goal if it is before `all'.
102 $(protobjs): fetchmail.h
104 fetchmail: $(srcdir)/rcfile_l.c $(srcdir)/rcfile_y.c $(objs)
105 $(CC) $(LDFLAGS) $(objs) $(LOADLIBS) -o fetchmail
108 # -I. is needed to find config.h in the build directory.
110 $(CC) $(defines) -c -I. -I$(srcdir) $(CFLAGS) $< $(OUTPUT_OPTION)
116 $(LEX) $(LEXFLAGS) $<
123 $(YACC) $(YACCFLAGS) $<
127 # For some losing Unix makes.
133 tagsrcs = $(srcs) $(srcdir)/rcfile_l.c $(srcdir)/rcfile_y.c
139 .PHONY: install installdirs
140 install: installdirs $(bindir)/$(instname) $(mandir)/$(instname).$(manext)
143 $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(mandir)
145 $(bindir)/$(instname): fetchmail
146 $(INSTALL_PROGRAM) fetchmail $@
148 $(mandir)/$(instname).$(manext): fetchmail.man
149 $(INSTALL_DATA) $(srcdir)/fetchmail.man $@
151 fetchmail.spec: $(srcdir)/Makefile.in $(srcdir)/specgen.sh
152 $(srcdir)/specgen.sh $(VERS) $(PL) >fetchmail.spec
154 .PHONY: clean realclean distclean mostlyclean
156 -rm -f fetchmail *.o core fetchmail.dvi \
157 rcfile_l.c rcfile_y.h rcfile_y.c \
158 fetchmail.tar fetchmail.tar.gz \
162 -rm -f Makefile config.h
163 -rm -f config.cache config.status config.log stamp-config
165 -rm -f fetchmail.log fetchmail.toc fetchmail.*aux fetchmail.spec
167 realclean: distclean # fetchmail.info*
171 Makefile: config.status $(srcdir)/Makefile.in
172 $(SHELL) config.status
173 @echo "You can ignore any makedepend error messages"
174 -makedepend -I. -fMakefile *.c
176 config.h: stamp-config
178 stamp-config: config.status $(srcdir)/config.h.in
179 $(SHELL) config.status
182 configure: configure.in
185 config.h.in: acconfig.h
186 autoheader $(ACFLAGS)
188 # This tells versions [3.59,3.63) of GNU make not to export all variables.
192 # Special dependencies, not easily handled without explicit rules
193 $(srcdir)/rcfile_l.c: $(srcdir)/rcfile_l.l
194 $(srcdir)/rcfile_y.c: $(srcdir)/rcfile_y.y
196 parser = $(srcdir)/rcfile_l.l $(srcdir)/rcfile_y.y
197 headers = $(srcdir)/fetchmail.h $(srcdir)/socket.h $(srcdir)/smtp.h \
198 $(srcdir)/mx.h $(srcdir)/md5.h $(srcdir)/md5global.h \
199 $(srcdir)/netrc.h $(srcdir)/tunable.h
200 extra = $(srcdir)/alloca.c $(srcdir)/getopt.[ch] $(srcdir)/getopt1.c \
201 $(srcdir)/strcasecmp.c
202 docs = $(srcdir)/COPYING $(srcdir)/README $(srcdir)/INSTALL $(srcdir)/NEWS \
203 $(srcdir)/NOTES $(srcdir)/fetchmail.lsm \
204 $(srcdir)/*.man $(srcdir)/sample.rcfile $(srcdir)/FAQ
205 config = $(srcdir)/Makefile.in $(srcdir)/configure.in $(srcdir)/configure \
206 $(srcdir)/config.guess $(srcdir)/config.h.in $(srcdir)/config.sub \
208 scripts = $(srcdir)/install.sh $(srcdir)/mkinstalldirs $(srcdir)/specgen.sh
209 all = $(docs) $(config) $(srcs) $(parser) $(headers) $(extra) $(scripts) \
213 @echo $(all) | tr "[ \t]" '\n' | sort | sed "s/\\./fetchmail-$(VERS)/" >MANIFEST
215 dist: fetchmail-$(VERS).tar.gz
216 ls -l fetchmail-$(VERS).tar.gz
218 fetchmail-$(VERS).tar: $(all)
219 (cd ..; tar -cf fetchmail-$(VERS).tar `cat fetchmail-$(VERS)/MANIFEST`)
220 mv ../fetchmail-$(VERS).tar fetchmail-$(VERS).tar
221 fetchmail-$(VERS).tar.gz: fetchmail-$(VERS).tar
222 gzip -f fetchmail-$(VERS).tar
224 # Tester for address parsing
226 gcc -DTESTMAIN -g rfc822.c -o rfc822
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 # Automatically generated dependencies will be put at the end of the makefile.
234 # DO NOT DELETE THIS LINE -- make depend depends on it.