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.
15 # CFLAGS = -g2 -5 # QNX
17 # LDLAGS = -g2 -5 # QNX
23 # How to invoke ranlib. This is only used by the `glob' subdirectory.
26 # NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
27 # See also `config.h'.
28 defines = -DRELEASE_ID=\"$(VERS)\" @DEFS@
29 # defines = -DHAVE_CONFIG_H -DQNX -DHAVE_UNISTD_H -DSTDC_HEADERS # QNX
31 # If your system needs extra libraries loaded in, define them here.
32 LOADLIBS = @LIBS@ @LEXLIB@
33 # LOADLIBS = -lsocket3r -lunix3r # QNX
35 # Any extra object files your system needs.
38 # Extra sources/objects for library functions not provided on the host system.
42 # Common prefix for machine-independent installed files.
44 # Common prefix for machine-dependent installed files.
45 exec_prefix = @exec_prefix@
47 # Name under which to install fetchmail
49 # Directory in which to install.
51 # Directory to install the Info files in.
53 # Number to put on the man page filename.
55 # Directory to install the man page in.
56 mandir = @mandir@/man$(manext)
58 # Program to install `make'.
59 INSTALL_PROGRAM = @INSTALL_PROGRAM@
60 # Program to install the man page.
61 INSTALL_DATA = @INSTALL_DATA@
62 # Generic install program.
65 # Program to format Texinfo source into Info files.
67 # Program to format Texinfo source into DVI files.
70 # Programs to make tags files.
74 popobjs = socket.o getpass.o pop2.o pop3.o imap.o fetchmail.o options.o \
75 rcfile_l.o rcfile_y.o rcfile.o daemon.o driver.o smtp.o xmalloc.o \
78 objs = $(popobjs) $(extras) $(EXTRAOBJ)
80 srcs = $(srcdir)/socket.c $(srcdir)/getpass.c $(srcdir)/pop2.c \
81 $(srcdir)/pop3.c $(srcdir)/imap.c $(srcdir)/fetchmail.c \
82 $(srcdir)/options.c $(srcdir)/rcfile.c $(srcdir)/daemon.c \
83 $(srcdir)/driver.c $(srcdir)/smtp.c $(srcdir)/xmalloc.c \
84 $(srcdir)/uid.c $(srcdir)/md5c.c $(srcdir)/md5ify.c
87 .SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi
89 all: fetchmail fetchmail.spec
91 # Some makes apparently use .PHONY as the default goal if it is before `all'.
94 $(popobjs): fetchmail.h
96 fetchmail: $(srcdir)/rcfile_l.c $(srcdir)/rcfile_y.c $(objs)
97 $(CC) $(LDFLAGS) $(objs) $(LOADLIBS) -o fetchmail
100 # -I. is needed to find config.h in the build directory.
102 $(CC) $(defines) -c -I. -I$(srcdir) $(CFLAGS) $< $(OUTPUT_OPTION)
108 $(LEX) $(LEXFLAGS) $<
115 $(YACC) $(YACCFLAGS) $<
119 # For some losing Unix makes.
125 tagsrcs = $(srcs) $(srcdir)/rcfile_l.c $(srcdir)/rcfile_y.c
131 .PHONY: install installdirs
132 install: installdirs \
133 $(bindir)/$(instname) $(mandir)/$(instname).$(manext) # $(infodir)/fetchmail.info
136 $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(mandir) # $(infodir)
138 $(bindir)/$(instname): fetchmail
139 $(INSTALL_PROGRAM) fetchmail $@
141 $(infodir)/fetchmail.info: fetchmail.info
142 if [ -r ./fetchmail.info ]; then dir=.; else dir=$(srcdir); fi; \
143 for file in $${dir}/fetchmail.info*; do \
144 name="`basename $$file`"; \
145 $(INSTALL_DATA) $$file \
146 `echo $@ | sed "s,fetchmail.info\$$,$$name,"`; \
148 # Run install-info only if it exists.
149 # Use `if' instead of just prepending `-' to the
150 # line so we notice real errors from install-info.
151 # We use `$(SHELL) -c' because some shells do not
152 # fail gracefully when there is an unknown command.
153 if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
154 install-info --infodir=$(infodir) $$dir/fetchmail.info; \
157 $(mandir)/$(instname).$(manext): fetchmail.man
158 $(INSTALL_DATA) $(srcdir)/fetchmail.man $@
160 fetchmail.spec: Makefile.in
161 specgen.sh $(VERS) >fetchmail.spec
163 .PHONY: clean realclean distclean mostlyclean
165 -rm -f fetchmail *.o core fetchmail.dvi \
166 rcfile_l.c rcfile_y.h rcfile_y.c fetchmail.tar fetchmail.tar.gz
169 -rm -f Makefile config.h
170 -rm -f config.cache config.status config.log stamp-config
172 -rm -f fetchmail.log fetchmail.toc fetchmail.*aux fetchmail.spec
174 realclean: distclean # fetchmail.info*
178 Makefile: config.status $(srcdir)/Makefile.in
179 $(SHELL) config.status
180 @echo "You can ignore any makedepend error messages"
181 -makedepend -fMakefile *.c
183 config.h: stamp-config
185 stamp-config: config.status $(srcdir)/config.h.in
186 $(SHELL) config.status
189 configure: configure.in
192 # This tells versions [3.59,3.63) of GNU make not to export all variables.
196 # Special dependencies, not easily handled without explicit rules
197 $(srcdir)/rcfile_l.c: $(srcdir)/rcfile_l.l
198 $(srcdir)/rcfile_y.c: $(srcdir)/rcfile_y.y
200 parser = $(srcdir)/rcfile_l.l $(srcdir)/rcfile_y.y
201 headers = $(srcdir)/fetchmail.h $(srcdir)/socket.h $(srcdir)/smtp.h \
202 $(srcdir)/md5.h $(srcdir)/md5global.h
203 extra = $(srcdir)/alloca.c $(srcdir)/getopt.[ch] $(srcdir)/getopt1.c \
204 $(srcdir)/strcasecmp.c $(srcdir)/strdup.c
205 docs = $(srcdir)/COPYING $(srcdir)/README $(srcdir)/INSTALL $(srcdir)/NEWS \
206 $(srcdir)/NOTES $(srcdir)/fetchmail.lsm $(srcdir)/RFC/*.txt \
207 $(srcdir)/*.man $(srcdir)/sample.rcfile
208 config = $(srcdir)/Makefile.in $(srcdir)/configure.in $(srcdir)/configure \
209 $(srcdir)/config.guess $(srcdir)/config.h.in $(srcdir)/config.sub
210 scripts = $(srcdir)/install.sh $(srcdir)/mkinstalldirs $(srcdir)/specgen.sh
211 all = $(docs) $(config) $(srcs) $(parser) $(headers) $(extra) $(scripts) \
215 @echo $(all) | tr "[ \t]" '\n' | sort | sed "s/\\./fetchmail-$(VERS)/" >MANIFEST
217 fetchmail-$(VERS).tar: $(all)
218 (cd ..; tar -cf fetchmail-$(VERS).tar `cat fetchmail-$(VERS)/MANIFEST`)
219 mv ../fetchmail-$(VERS).tar fetchmail-$(VERS).tar
220 fetchmail-$(VERS).tar.gz: fetchmail-$(VERS).tar
221 gzip -f fetchmail-$(VERS).tar
223 # The automatically generated dependencies below may omit config.h
224 # because it is included with ``#include <config.h>'' rather than
225 # ``#include "config.h"''. So we add the explicit dependency to make sure.
228 # Automatically generated dependencies will be put at the end of the makefile.
229 # DO NOT DELETE THIS LINE -- make depend depends on it.