]> Pileus Git - ~andy/fetchmail/blob - Makefile.in
b3e85b31ef4d34c9be5c98a476de44d649f4c6bd
[~andy/fetchmail] / Makefile.in
1 # Makefile for fetchmail
2
3 # If you're running QNX, we can't assume a working autoconf.
4 # So just uncomment all the lines marked QNX.
5
6 VERS=1.8
7
8 # Ultrix 2.2 make doesn't expand the value of VPATH.
9 srcdir = @srcdir@
10 VPATH = @srcdir@
11
12 CC = @CC@
13
14 CFLAGS = @CFLAGS@
15 # CFLAGS =  -g2 -5      # QNX
16 LDFLAGS = @LDFLAGS@
17 # LDLAGS =  -g2 -5      # QNX
18 LEX = @LEX@
19 LEXFLAGS=
20 YACC = @YACC@
21 YACCFLAGS = -dt
22
23 # How to invoke ranlib.  This is only used by the `glob' subdirectory.
24 RANLIB = @RANLIB@
25
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
30
31 # If your system needs extra libraries loaded in, define them here.
32 LOADLIBS = @LIBS@ @LEXLIB@
33 # LOADLIBS = -lsocket3r -lunix3r        # QNX
34
35 # Any extra object files your system needs.
36 extras = @LIBOBJS@
37
38 # Extra sources/objects for library functions not provided on the host system.
39 EXTRASRC = @EXTRASRC@
40 EXTRAOBJ = @EXTRAOBJ@
41
42 # Common prefix for machine-independent installed files.
43 prefix = @prefix@
44 # Common prefix for machine-dependent installed files.
45 exec_prefix = @exec_prefix@
46
47 # Name under which to install fetchmail
48 instname = fetchmail
49 # Directory in which to install.
50 bindir = @bindir@
51 # Directory to install the Info files in.
52 infodir = @infodir@
53 # Number to put on the man page filename.
54 manext = 1
55 # Directory to install the man page in.
56 mandir = @mandir@/man$(manext)
57
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.
63 INSTALL = @INSTALL@
64
65 # Program to format Texinfo source into Info files.
66 MAKEINFO = makeinfo
67 # Program to format Texinfo source into DVI files.
68 TEXI2DVI = texi2dvi
69
70 # Programs to make tags files.
71 ETAGS = etags -tw
72 CTAGS = ctags -tw
73
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 \
76        uid.o md5c.o md5ify.o
77
78 objs = $(popobjs) $(extras) $(EXTRAOBJ)
79
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
85
86 .SUFFIXES:
87 .SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi
88
89 all: fetchmail fetchmail.spec
90
91 # Some makes apparently use .PHONY as the default goal if it is before `all'.
92 .PHONY: all check
93
94 $(popobjs): fetchmail.h
95
96 fetchmail: $(srcdir)/rcfile_l.c $(srcdir)/rcfile_y.c $(objs)
97         $(CC) $(LDFLAGS) $(objs) $(LOADLIBS) -o fetchmail
98
99
100 # -I. is needed to find config.h in the build directory.
101 .c.o:
102         $(CC) $(defines) -c -I. -I$(srcdir) $(CFLAGS) $< $(OUTPUT_OPTION)
103
104 # lex rule
105 .l.o:
106
107 .l.c:
108         $(LEX) $(LEXFLAGS) $<
109         mv lex.yy.c $@
110
111 # yacc rule
112 .y.o:
113
114 .y.c:
115         $(YACC) $(YACCFLAGS) $<
116         mv y.tab.c $@
117         mv -f y.tab.h $*.h
118
119 # For some losing Unix makes.
120 SHELL = /bin/sh
121 MAKE = make
122
123 FORCE:
124
125 tagsrcs = $(srcs) $(srcdir)/rcfile_l.c $(srcdir)/rcfile_y.c
126 TAGS: $(tagsrcs)
127         $(ETAGS) $(tagsrcs)
128 tags: $(tagsrcs)
129         $(CTAGS) $(tagsrcs)
130
131 .PHONY: install installdirs
132 install: installdirs \
133          $(bindir)/$(instname) $(mandir)/$(instname).$(manext) # $(infodir)/fetchmail.info
134
135 installdirs:
136         $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(mandir) # $(infodir)
137
138 $(bindir)/$(instname): fetchmail
139         $(INSTALL_PROGRAM) fetchmail $@
140
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,"`; \
147         done
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; \
155         else true; fi
156
157 $(mandir)/$(instname).$(manext): fetchmail.man
158         $(INSTALL_DATA) $(srcdir)/fetchmail.man $@
159
160 fetchmail.spec: Makefile.in
161         specgen.sh $(VERS) >fetchmail.spec
162
163 .PHONY: clean realclean distclean mostlyclean
164 clean: 
165         -rm -f fetchmail *.o core fetchmail.dvi \
166                rcfile_l.c rcfile_y.h rcfile_y.c fetchmail.tar fetchmail.tar.gz
167
168 distclean: clean 
169         -rm -f Makefile config.h
170         -rm -f config.cache config.status config.log stamp-config
171         -rm -f TAGS tags
172         -rm -f fetchmail.log fetchmail.toc fetchmail.*aux fetchmail.spec
173
174 realclean: distclean # fetchmail.info*
175
176 mostlyclean: clean
177
178 Makefile: config.status $(srcdir)/Makefile.in
179         $(SHELL) config.status
180         @echo "You can ignore any makedepend error messages"
181         -makedepend -fMakefile *.c
182
183 config.h: stamp-config 
184
185 stamp-config: config.status $(srcdir)/config.h.in
186         $(SHELL) config.status
187         touch stamp-config
188
189 configure: configure.in
190         autoconf $(ACFLAGS)
191
192 # This tells versions [3.59,3.63) of GNU make not to export all variables.
193 .NOEXPORT:
194
195
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
199
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) \
212         $(srcdir)/MANIFEST
213
214 MANIFEST: $(srcdir)
215         @echo $(all) | tr "[ \t]" '\n' | sort | sed "s/\\./fetchmail-$(VERS)/" >MANIFEST
216
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
222
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.
226 $(objs): config.h
227
228 # Automatically generated dependencies will be put at the end of the makefile.
229 # DO NOT DELETE THIS LINE -- make depend depends on it.