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