]> Pileus Git - ~andy/fetchmail/blob - Makefile.in
Explain the < test.
[~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 PACKAGE = fetchmail
7 VERSION = 5.6.5
8
9 SUBDIRS = @POSUB@  
10
11 # Ultrix 2.2 make doesn't expand the value of VPATH.
12 srcdir = @srcdir@
13 VPATH = @srcdir@
14
15 CC = @CC@
16 # CC = cc               # QNX
17
18 CFLAGS = @CFLAGS@ -I$(top_srcdir)/intl
19 # CFLAGS =  -g2 -5      # QNX
20 LDFLAGS = @LDFLAGS@
21 # LDFLAGS =  -g2 -5 -N64k       # QNX
22 LEX = @LEX@
23 LEXFLAGS=
24 YACC = @YACC@
25 # YACC = yacc
26 YACCFLAGS = -d # -t
27
28 CEFLAGS = @CEFLAGS@
29 CPFLAGS = @CPFLAGS@
30 LDEFLAGS = @LDEFLAGS@
31
32 INTLDEPS = @INTLDEPS@
33 INTLLIBS = @INTLLIBS@
34 INTLOBJS = @INTLOBJS@
35
36 # How to invoke ranlib.  This is only used by the `glob' subdirectory.
37 RANLIB = @RANLIB@
38
39 # NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
40 # See also `config.h'.
41 DEFS = @DEFS@ @EXTRADEFS@
42 # DEFS = -DQNX -DHAVE_CONFIG_H -DHAVE_UNISTD_H -DHAVE_STDARG_H -DSTDC_HEADERS   # QNX
43 defines = $(DEFS)
44
45 # If your system needs extra libraries loaded in, define them here.
46 # In particular, add -lresolv if you are running bind 4.9.5
47 LOADLIBS = @LIBS@ @LEXLIB@
48 # LOADLIBS = -lsocket3r -lunix3r        # QNX
49
50 # Any extra object files your system needs.
51 extras = @LIBOBJS@ $(INTLDEPS)
52
53 # Extra sources/objects for library functions not provided on the host system.
54 EXTRASRC = @EXTRASRC@
55 # EXTRASRC = $(srcdir)/strcasecmp.c $(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/alloca.c   # QNX
56 EXTRAOBJ = @EXTRAOBJ@
57 # EXTRAOBJ = strcasecmp.o getopt.o getopt1.o alloca.o
58
59 DESTDIR = 
60
61 # Common prefix for machine-independent installed files.
62 prefix = @prefix@
63 # Common prefix for machine-dependent installed files.
64 exec_prefix = @exec_prefix@
65
66 # Directory in which to install.
67 bindir = @bindir@
68 # Directory to install the Info files in.
69 infodir = @infodir@
70 # Directory to install data files.
71 datadir = @datadir@
72 # Number to put on the man page filename.
73 manext = 1
74 # Directory to install the man page in.
75 mandir = @mandir@/man$(manext)
76
77 # Toplevel build directory
78 top_builddir = .
79 top_srcdir = @top_srcdir@
80
81 # Program to install `make'.
82 INSTALL_PROGRAM = @INSTALL_PROGRAM@
83 # Program to install the man page.
84 INSTALL_DATA = @INSTALL_DATA@
85 # Generic install program.
86 INSTALL = @INSTALL@
87
88 # Program to format Texinfo source into Info files.
89 MAKEINFO = makeinfo
90 # Program to format Texinfo source into DVI files.
91 TEXI2DVI = texi2dvi
92
93 # Programs to make tags files.
94 ETAGS = etags
95 CTAGS = ctags
96
97 protobjs = rcfile_y.o rcfile_l.o socket.o getpass.o pop2.o pop3.o imap.o \
98        etrn.o odmr.o fetchmail.o idle.o env.o options.o daemon.o driver.o \
99        sink.o rfc822.o smtp.o xmalloc.o uid.o mxget.o md5ify.o cram.o \
100        kerberos.o gssapi.o opie.o rpa.o interface.o netrc.o base64.o \
101        error.o unmime.o conf.o checkalias.o smbdes.o smbencrypt.o smbmd4.o \
102        smbutil.o ipv6-connect.o
103
104 objs = $(protobjs) $(extras) $(EXTRAOBJ)
105
106 srcs = $(srcdir)/socket.c $(srcdir)/getpass.c $(srcdir)/pop2.c          \
107        $(srcdir)/pop3.c $(srcdir)/imap.c $(srcdir)/etrn.c               \
108        $(srcdir)/odmr.c $(srcdir)/fetchmail.c $(srcdir)/env.c           \
109        $(srcdir)/idle.c $(srcdir)/options.c $(srcdir)/daemon.c          \
110        $(srcdir)/driver.c $(srcdir)/sink.c $(srcdir)/rfc822.c           \
111        $(srcdir)/smtp.c $(srcdir)/xmalloc.c $(srcdir)/uid.c             \
112        $(srcdir)/mxget.c $(srcdir)/md5ify.c $(srcdir)/cram.c            \
113        $(srcdir)/kerberos.c $(srcdir)/gssapi.c  $(srcdir)/opie.c        \
114        $(srcdir)/rpa.c $(srcdir)/interface.c $(srcdir)/netrc.c          \
115        $(srcdir)/base64.c $(srcdir)/error.c $(srcdir)/unmime.c          \
116        $(srcdir)/conf.c $(srcdir)/checkalias.c $(srcdir)/smbdes.c       \
117        $(srcdir)/smbencrypt.c $(srcdir)/smbmd4.c $(srcdir)/smbutil.c    \
118        $(srcdir)/ipv6-connect.c
119
120 .SUFFIXES:
121 .SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi
122
123 all: fetchmail po
124
125 # Some makes apparently use .PHONY as the default goal if it is before `all'.
126 .PHONY: all
127
128 fetchmail: $(objs)
129         $(CC) $(LDEFLAGS) $(LDFLAGS) $(objs) $(LOADLIBS) -o fetchmail
130
131 po:     dummy
132         @POMAKE@
133
134 $(INTLDEPS): dummy
135         @echo "Making $@ in intl"; \
136         cd intl; $(MAKE) || exit 1
137
138 dummy:
139
140 # Tester for address parsing
141 rfc822: rfc822.c
142         gcc -DTESTMAIN -g rfc822.c -o rfc822
143
144 # Stand-alone MIME decoder
145 unmime: unmime.c base64.c rfc822.c xmalloc.c error.c
146         $(CC) -DSTANDALONE -DHAVE_CONFIG_H -I. -g -o $@ $^
147
148
149 # Stand-alone netrc tester
150 netrc: netrc.c xmalloc.o error.o
151         $(CC) -DSTANDALONE -DHAVE_CONFIG_H -I. -g -o $@ $^
152
153 .c.o:
154         $(CC) $(defines) -c $(CPFLAGS) -I. -I$(srcdir) $(CEFLAGS) $(CFLAGS) $<
155
156 # For some losing Unix makes.
157 SHELL = /bin/sh
158 @SET_MAKE@
159
160 tagsrcs = $(srcs) rcfile_l.c rcfile_y.c
161 TAGS: $(tagsrcs)
162         $(ETAGS) $(tagsrcs)
163 tags: $(tagsrcs)
164         $(CTAGS) $(tagsrcs)
165
166 .PHONY: install uninstall
167 install:
168         @echo "Creating installation directories..." 
169         $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)
170         @echo "Installing fetchmail binary..."
171         $(INSTALL_PROGRAM) ./fetchmail $(DESTDIR)$(bindir)/fetchmail
172         @echo "Installing fetchmail configurator..."
173         $(INSTALL_PROGRAM) ${srcdir}/fetchmailconf $(DESTDIR)$(bindir)/fetchmailconf
174         @echo "Installing manual page..."
175         $(INSTALL_DATA) $(srcdir)/fetchmail.man $(DESTDIR)$(mandir)/fetchmail.$(manext)
176         rm -f $(DESTDIR)$(mandir)/fetchmailconf.$(manext)
177         cd $(DESTDIR)$(mandir) && ln -s fetchmail.$(manext) fetchmailconf.$(manext)
178         @echo "Installing language catalogs..."
179         @POMAKE@ install
180
181 uninstall:
182         rm -f $(DESTDIR)$(bindir)/fetchmail $(DESTDIR)$(bindir)/fetchmailconf
183         rm -f $(DESTDIR)$(mandir)/fetchmail.$(manext) $(DESTDIR)$(mandir)/fetchmailconf.$(manext)
184         @POMAKE@ uninstall
185
186 .PHONY: clean realclean distclean mostlyclean
187 clean: 
188         @POMAKE@ clean
189         -rm -f fetchmail *.o core fetchmail.dvi \
190                rcfile_l.c rcfile_y.h rcfile_y.c \
191                fetchmail.tar fetchmail.tar.gz \
192                netrc rfc822 unmime fetchmail-man.html
193
194 distclean: clean 
195         @POMAKE@ distclean
196         -rm -f Makefile config.h TAGS tags
197         -rm -f config.cache config.status config.log stamp-config
198
199 realclean: distclean
200         @POMAKE@ clean
201         -rm -f FAQ FEATURES NOTES MANIFEST 
202         -rm -f config.cache config.log Makefile
203         -rm -f fetchmail-*.tar.gz fetchmail-*.i386.rpm 
204
205 mostlyclean: clean
206
207 # These magic rules are copied from the autoconf documentation
208 # except that Harry McGavran says the autoheader call in the third
209 # one below is unnecessary and causes problems with cross-platform builds.
210
211 ${srcdir}/configure: configure.in aclocal.m4
212         cd ${srcdir} && autoconf
213      
214 # autoheader might not change config.h.in, so touch a stamp file.
215 ${srcdir}/config.h.in: stamp-h.in
216
217 ${srcdir}/stamp-h.in: configure.in aclocal.m4 acconfig.h # config.h.top config.h.bot
218         cd ${srcdir} # && autoheader
219         echo timestamp> ${srcdir}/stamp-h.in
220      
221 config.h: stamp-h
222 stamp-h: config.h.in config.status
223         ./config.status
224      
225 Makefile: Makefile.in config.status
226         ./config.status
227      
228 config.status: configure
229         ./config.status --recheck
230
231 # This tells versions [3.59,3.63) of GNU make not to export all variables.
232 .NOEXPORT:
233
234 # Special dependencies, not easily handled portably without explicit rules
235 rcfile_l.c rcfile_l.h: $(srcdir)/rcfile_l.l
236         $(LEX) $(LEXFLAGS) $(srcdir)/rcfile_l.l
237         sed <lex.yy.c >rcfile_l.c -e "/lex\\.yy\\.c/s//rcfile_l.c/"
238 rcfile_y.c rcfile_y.h: $(srcdir)/rcfile_y.y
239         @echo "expect conflicts:  2 shift/reduce"
240         $(YACC) $(YACCFLAGS) $(srcdir)/rcfile_y.y
241         mv y.tab.c rcfile_y.c
242         mv -f y.tab.h rcfile_y.h
243
244 # These must be explicit, because the .c files often don't exist at
245 # makefile build time. 
246 rcfile_l.o: rcfile_y.c rcfile_y.h config.h fetchmail.h
247 rcfile_y.o: rcfile_y.c rcfile_y.h config.h fetchmail.h
248
249 parser = $(srcdir)/rcfile_l.l $(srcdir)/rcfile_y.y
250 headers = $(srcdir)/fetchmail.h $(srcdir)/socket.h $(srcdir)/smtp.h \
251         $(srcdir)/mx.h $(srcdir)/md5.h $(srcdir)/md5global.h \
252         $(srcdir)/netrc.h $(srcdir)/tunable.h $(srcdir)/i18n.h \
253         $(srcdir)/aclocal.m4 $(srcdir)/ntlm.h $(srcdir)/smb.h \
254         $(srcdir)/smbbyteorder.h $(srcdir)/smbdes.h $(srcdir)/smbencrypt.h \
255         $(srcdir)/smbmd4.h
256 extra = $(srcdir)/alloca.c $(srcdir)/getopt.[ch] $(srcdir)/getopt1.c \
257         $(srcdir)/strcasecmp.c $(srcdir)/strstr.c $(srcdir)/memmove.c \
258         $(srcdir)/md5c.c
259 docs = $(srcdir)/COPYING $(srcdir)/FEATURES $(srcdir)/fetchmail-features.html \
260         $(srcdir)/design-notes.html $(srcdir)/NOTES \
261         $(srcdir)/todo.html $(srcdir)/TODO \
262         $(srcdir)/INSTALL $(srcdir)/NEWS $(srcdir)/README \
263         $(srcdir)/README.NTLM $(srcdir)/fetchmail.lsm \
264         $(srcdir)/*.man $(srcdir)/FAQ $(srcdir)/fetchmail-FAQ.html
265 config = $(srcdir)/Makefile.in $(srcdir)/configure.in $(srcdir)/configure \
266         $(srcdir)/config.guess $(srcdir)/config.h.in $(srcdir)/config.sub \
267         $(srcdir)/acconfig.h
268 scripts = $(srcdir)/install.sh $(srcdir)/mkinstalldirs \
269         $(srcdir)/specgen.sh $(srcdir)/lsmgen.sh $(srcdir)/fetchmailconf
270 all = $(docs) $(config) $(srcs) $(parser) $(headers) $(extra) $(scripts) \
271         $(srcdir)/rh-config/* $(srcdir)/debian/* $(srcdir)/contrib/*[A-Za-uw-z] \
272         $(srcdir)/intl/* $(srcdir)/po/* $(srcdir)/beos/* ABOUT-NLS \
273         $(srcdir)/MANIFEST
274
275 MANIFEST: $(srcdir) Makefile.in
276         @echo $(all) | tr "[ \t]" '\n' | sed -e '/^\.\//s///' | sort >MANIFEST
277         @wc -l MANIFEST
278
279 distdocs: FAQ FEATURES NOTES fetchmail-man.html
280
281 FAQ: fetchmail-FAQ.html
282         echo "   (This document was generated from fetchmail-FAQ.html)" >FAQ
283         lynx -dump -nolist fetchmail-FAQ.html >>FAQ
284
285 FEATURES: fetchmail-features.html
286         echo "   (This document was generated from fetchmail-features.html)" >FEATURES
287         lynx -dump -nolist fetchmail-features.html | grep -v "Back to " >>FEATURES
288
289 NOTES: design-notes.html
290         echo "   (This document was generated from design-notes.html)" >NOTES
291         lynx -dump -nolist design-notes.html | grep -v "Back to " >>NOTES
292
293 TODO: todo.html
294         echo "   (This document was generated from todo.html)" >TODO
295         lynx -dump -nolist todo.html | grep -v "Back to " >>TODO
296
297 # man2html no longer chokes and dies on this man page,
298 # but manServer.pl does a much better job. 
299 fetchmail-man.html: fetchmail.man
300         manServer.pl fetchmail.man >fetchmail-man.html
301
302 # Make distribution, update LSM with proper size, remake distribution
303 # (Making fetchmail-man.html is a kluge to ensure that it will be
304 # available when I upload the distribution.)
305 dist: Makefile.in distdocs
306         rm -f MANIFEST; make MANIFEST;
307         touch fetchmail.lsm
308         make fetchmail-$(VERSION).tar.gz 
309         lsmgen.sh $(VERSION) `wc -c fetchmail-$(VERSION).tar.gz` >fetchmail.lsm
310         make fetchmail-$(VERSION).tar.gz
311         ls -l fetchmail-$(VERSION).tar.gz
312         @echo "Don't forget to build RPMs from root!"
313
314 fetchmail-$(VERSION).tar.gz: $(all)
315         (cd ..; ln -sf fetchmail fetchmail-$(VERSION))
316         (cd ..; tar -czf fetchmail-$(VERSION).tar.gz `sed <fetchmail-$(VERSION)/MANIFEST s:^:fetchmail-$(VERSION)/:`)
317         mv -f ../fetchmail-$(VERSION).tar.gz .
318         rm ../fetchmail-$(VERSION)
319
320 # Make RPMs.  You need to be root to make this work
321 RPMROOT=/usr/src/redhat
322 RPM = rpm
323 RPMFLAGS = -ba
324 rpm: dist
325         cp fetchmail-$(VERSION).tar.gz fetchmail.xpm $(RPMROOT)/SOURCES;
326         $(srcdir)/specgen.sh $(VERSION) >$(RPMROOT)/SPECS/fetchmail.spec
327         cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) fetchmail.spec  
328         cp $(RPMROOT)/RPMS/`arch|sed 's/i[4-9]86/i386/'`/fetchmail*-$(VERSION)*.rpm $(srcdir)
329         cp $(RPMROOT)/SRPMS/fetchmail*-$(VERSION)*.src.rpm $(srcdir)
330
331 # The following sets edit modes for GNU EMACS.
332 # Local Variables:
333 # compile-command:"configure"
334 # End:
335
336 # Automatically generated dependencies will be put at the end of the makefile.