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