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'.
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 = $(prefix)
47 # Name under which to install fetchmail
49 # Directory in which to install.
50 bindir = $(exec_prefix)/bin
51 # Directory to install the Info files in.
52 infodir = $(prefix)/info
53 # Number to put on the man page filename.
55 # Directory to install the man page in.
56 mandir = $(prefix)/man/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)
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)/md5c.c $(srcdir)/md5ify.c
87 .SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi
92 test -f config.h || touch config.h
93 test -f rcfile_y.h || touch rcfile_y.h
94 makedepend -fMakefile.in *.c
96 # Some makes apparently use .PHONY as the default goal is it is before `all'.
99 $(popobjs): fetchmail.h
101 fetchmail: $(srcdir)/rcfile_l.c $(srcdir)/rcfile_y.c $(objs)
102 $(CC) $(LDFLAGS) $(objs) $(LOADLIBS) -o fetchmail
105 # -I. is needed to find config.h in the build directory.
107 $(CC) $(defines) -c -I. -I$(srcdir) $(CFLAGS) $< $(OUTPUT_OPTION)
113 $(LEX) $(LEXFLAGS) $<
120 $(YACC) $(YACCFLAGS) $<
124 # For some losing Unix makes.
130 tagsrcs = $(srcs) $(srcdir)/rcfile_l.c $(srcdir)/rcfile_y.c
136 .PHONY: install installdirs
137 install: installdirs \
138 $(bindir)/$(instname) $(mandir)/$(instname).$(manext)
141 $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(mandir)
143 $(bindir)/$(instname): fetchmail
144 $(INSTALL_PROGRAM) fetchmail $@
146 $(infodir)/fetchmail.info: fetchmail.info
147 if [ -r ./fetchmail.info ]; then dir=.; else dir=$(srcdir); fi; \
148 for file in $${dir}/fetchmail.info*; do \
149 name="`basename $$file`"; \
150 $(INSTALL_DATA) $$file \
151 `echo $@ | sed "s,fetchmail.info\$$,$$name,"`; \
153 # Run install-info only if it exists.
154 # Use `if' instead of just prepending `-' to the
155 # line so we notice real errors from install-info.
156 # We use `$(SHELL) -c' because some shells do not
157 # fail gracefully when there is an unknown command.
158 if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
159 install-info --infodir=$(infodir) $$dir/fetchmail.info; \
162 $(mandir)/$(instname).$(manext): fetchmail.man
163 $(INSTALL_DATA) $(srcdir)/fetchmail.man $@
166 .PHONY: clean realclean distclean mostlyclean
168 -rm -f fetchmail *.o core fetchmail.dvi \
169 rcfile_l.c rcfile_y.h rcfile_y.c fetchmail.tar fetchmail.tar.gz
172 -rm -f Makefile config.h
173 -rm -f config.cache config.status config.log stamp-config
175 -rm -f fetchmail.log fetchmail.toc fetchmail.*aux
177 realclean: fetchmail.info* distclean
181 Makefile: config.status $(srcdir)/Makefile.in
182 $(SHELL) config.status
184 config.h: stamp-config
186 stamp-config: config.status $(srcdir)/config.h.in
187 $(SHELL) config.status
190 configure: configure.in
193 # This tells versions [3.59,3.63) of GNU make not to export all variables.
197 # Special dependencies, not easily handled without explicit rules
198 $(srcdir)/rcfile_l.c: $(srcdir)/rcfile_l.l
199 $(srcdir)/rcfile_y.c: $(srcdir)/rcfile_y.y
200 echo "expect \"conflicts: 5 shift/reduce\""
201 $(YACC) $(YACCFLAGS) $<
205 parser = $(srcdir)/rcfile_l.l $(srcdir)/rcfile_y.y
206 headers = $(srcdir)/fetchmail.h $(srcdir)/socket.h $(srcdir)/smtp.h
207 extra = $(srcdir)/alloca.c $(srcdir)/getopt.[ch] $(srcdir)/getopt1.c \
208 $(srcdir)/md5*.[ch] $(srcdir)/strcasecmp.c $(srcdir)/strdup.c
209 docs = $(srcdir)/COPYING $(srcdir)/README $(srcdir)/INSTALL $(srcdir)/NEWS \
210 $(srcdir)/fetchmail.lsm $(srcdir)/RFC/*.txt \
211 $(srcdir)/*.man $(srcdir)/sample.rcfile
212 config = $(srcdir)/Makefile.in $(srcdir)/configure.in $(srcdir)/configure \
213 $(srcdir)/config.guess $(srcdir)/config.h.in $(srcdir)/config.sub
214 scripts = $(srcdir)/install.sh $(srcdir)/mkinstalldirs
215 all = $(docs) $(config) $(srcs) $(parser) $(headers) $(extra) $(scripts) \
219 @echo $(all) | tr "[ \t]" '\n' | sort | sed "s/\\./fetchmail-$(VERS)/" >MANIFEST
221 fetchmail-$(VERS).tar: $(all)
222 (cd ..; tar -cf fetchmail-$(VERS).tar `cat fetchmail-$(VERS)/MANIFEST`)
223 mv ../fetchmail-$(VERS).tar fetchmail-$(VERS).tar
224 fetchmail-$(VERS).tar.gz: fetchmail-$(VERS).tar
225 gzip -f fetchmail-$(VERS).tar
227 # The automatically generated dependencies below may omit config.h
228 # because it is included with ``#include <config.h>'' rather than
229 # ``#include "config.h"''. So we add the explicit dependency to make sure.
232 # Automatically generated dependencies will be put at the end of the file.