]> 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 VERS=4.4.6
7
8 # Ultrix 2.2 make doesn't expand the value of VPATH.
9 srcdir = @srcdir@
10 VPATH = @srcdir@
11
12 CC = @CC@
13 # CC = cc               # QNX
14
15 CFLAGS = @CFLAGS@
16 # CFLAGS =  -g2 -5      # QNX
17 LDFLAGS = @LDFLAGS@
18 # LDLAGS =  -g2 -5      # QNX
19 LEX = @LEX@
20 LEXFLAGS=
21 YACC = @YACC@
22 # YACC = yacc
23 YACCFLAGS = -dt
24
25 CEFLAGS = @CEFLAGS@
26 LDEFLAGS = @LDEFLAGS@
27
28 # How to invoke ranlib.  This is only used by the `glob' subdirectory.
29 RANLIB = @RANLIB@
30
31 # NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
32 # See also `config.h'.
33 DEFS = @DEFS@ @EXTRADEFS@
34 # DEFS = -DQNX -DHAVE_CONFIG_H -DHAVE_UNISTD_H -DHAVE_STDARG_H -DSTDC_HEADERS   # QNX
35 defines =  -DRELEASE_ID=\"$(VERS)\" $(DEFS)
36
37 # If your system needs extra libraries loaded in, define them here.
38 # In particular, add -lresolv if you are running bind 4.9.5
39 LOADLIBS = @LIBS@ @LEXLIB@
40 # LOADLIBS = -lsocket3r -lunix3r        # QNX
41
42 # Any extra object files your system needs.
43 extras = @LIBOBJS@
44
45 # Extra sources/objects for library functions not provided on the host system.
46 EXTRASRC = @EXTRASRC@
47 # EXTRASRC = $(srcdir)/strcasecmp.c $(srcdir)/getopt.c $(srcdir)/getopt1.c $(srcdir)/alloca.c   # QNX
48 EXTRAOBJ = @EXTRAOBJ@
49 # EXTRAOBJ = strcasecmp.o getopt.o getopt1.o alloca.o
50
51 # Common prefix for machine-independent installed files.
52 prefix = @prefix@
53 # Common prefix for machine-dependent installed files.
54 exec_prefix = @exec_prefix@
55
56 # Name under which to install fetchmail
57 instname = fetchmail
58 # Directory in which to install.
59 bindir = @bindir@
60 # Directory to install the Info files in.
61 infodir = @infodir@
62 # Number to put on the man page filename.
63 manext = 1
64 # Directory to install the man page in.
65 mandir = @mandir@/man$(manext)
66
67 # Program to install `make'.
68 INSTALL_PROGRAM = @INSTALL_PROGRAM@
69 # Program to install the man page.
70 INSTALL_DATA = @INSTALL_DATA@
71 # Generic install program.
72 INSTALL = @INSTALL@
73
74 # Program to format Texinfo source into Info files.
75 MAKEINFO = makeinfo
76 # Program to format Texinfo source into DVI files.
77 TEXI2DVI = texi2dvi
78
79 # Programs to make tags files.
80 ETAGS = etags
81 CTAGS = ctags
82
83 protobjs = rcfile_y.o rcfile_l.o socket.o getpass.o pop2.o pop3.o imap.o \
84        etrn.o fetchmail.o env.o options.o daemon.o driver.o rfc822.o smtp.o \
85        xmalloc.o uid.o mxget.o md5c.o md5ify.o rpa.o interface.o netrc.o \
86        base64.o error.o unmime.o
87
88 objs = $(protobjs) $(extras) $(EXTRAOBJ)
89
90 srcs = $(srcdir)/socket.c $(srcdir)/getpass.c $(srcdir)/pop2.c          \
91        $(srcdir)/pop3.c $(srcdir)/imap.c $(srcdir)/etrn.c               \
92        $(srcdir)/fetchmail.c $(srcdir)/env.c                            \
93        $(srcdir)/options.c $(srcdir)/daemon.c                           \
94        $(srcdir)/driver.c $(srcdir)/rfc822.c $(srcdir)/smtp.c           \
95        $(srcdir)/xmalloc.c $(srcdir)/uid.c $(srcdir)/mxget.c            \
96        $(srcdir)/md5c.c $(srcdir)/md5ify.c $(srcdir)/rpa.c              \
97        $(srcdir)/interface.c $(srcdir)/netrc.c $(srcdir)/base64.c       \
98        $(srcdir)/error.c $(srcdir)/unmime.c
99
100 .SUFFIXES:
101 .SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi
102
103 all: fetchmail
104
105 # Some makes apparently use .PHONY as the default goal if it is before `all'.
106 .PHONY: all
107
108 fetchmail: $(objs)
109         $(CC) $(LDEFLAGS) $(LDFLAGS) $(objs) $(LOADLIBS) -o fetchmail
110
111 # Tester for address parsing
112 rfc822: rfc822.c
113         gcc -DTESTMAIN -g rfc822.c -o rfc822
114
115 # Stand-alone MIME decoder
116 unmime: unmime.c base64.c rfc822.c xmalloc.c error.c memmove.c
117         $(CC) -DSTANDALONE -g -o $@ $^ 
118
119 .c.o:
120         $(CC) $(defines) -c -I$(srcdir) -I. $(CEFLAGS) $(CFLAGS) $<
121
122 # For some losing Unix makes.
123 SHELL = /bin/sh
124 MAKE = make
125
126 tagsrcs = $(srcs) rcfile_l.c rcfile_y.c
127 TAGS: $(tagsrcs)
128         $(ETAGS) $(tagsrcs)
129 tags: $(tagsrcs)
130         $(CTAGS) $(tagsrcs)
131
132 .PHONY: install installdirs uninstall
133 install: installdirs $(bindir)/$(instname) $(mandir)/$(instname).$(manext)
134
135 installdirs:
136         $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(mandir)
137
138 $(bindir)/$(instname): fetchmail
139         @echo "Installing binary..."
140         $(INSTALL_PROGRAM) fetchmail $@
141
142 $(mandir)/$(instname).$(manext): fetchmail.man
143         @echo "Installing manual page..."
144         $(INSTALL_DATA) $(srcdir)/fetchmail.man $@
145
146 uninstall:
147         rm -f $(bindir)/$(instname) $(mandir)/$(instname).$(manext)
148
149 .PHONY: clean realclean distclean mostlyclean
150 clean: 
151         -rm -f fetchmail *.o core fetchmail.dvi \
152                rcfile_l.c rcfile_y.h rcfile_y.c \
153                fetchmail.tar fetchmail.tar.gz \
154                rfc822 unmime
155
156 distclean: clean 
157         -rm -f Makefile config.h TAGS tags
158         -rm -f config.cache config.status config.log stamp-config
159
160 realclean: distclean
161         -rm -f FAQ FEATURES NOTES MANIFEST 
162         -rm -f config.cache config.log Makefile
163         -rm -f fetchmail-*.tar.gz fetchmail-*.rpm 
164
165 mostlyclean: clean
166
167 config.status: configure
168         $(srcdir)/configure
169
170 config.h: config.status config.h.in
171         sh config.status; touch config.h
172
173 Makefile: config.status Makefile.in
174         sh config.status
175
176 configure: configure.in
177         autoconf $(ACFLAGS)
178
179 config.h.in: acconfig.h configure.in
180         autoheader $(ACFLAGS); touch config.h.in
181
182 # This tells versions [3.59,3.63) of GNU make not to export all variables.
183 .NOEXPORT:
184
185 # Special dependencies, not easily handled portably without explicit rules
186 rcfile_l.c rcfile_l.h: $(srcdir)/rcfile_l.l
187         $(LEX) $(LEXFLAGS) $(srcdir)/rcfile_l.l
188         mv lex.yy.c rcfile_l.c
189 rcfile_y.c rcfile_y.h: $(srcdir)/rcfile_y.y
190         @echo "expect conflicts:  2 shift/reduce"
191         $(YACC) $(YACCFLAGS) $(srcdir)/rcfile_y.y
192         mv y.tab.c rcfile_y.c
193         mv -f y.tab.h rcfile_y.h
194
195 # These must be explicit, because the .c files often don't exist at
196 # makefile build time. 
197 rcfile_l.o: rcfile_y.c rcfile_y.h config.h fetchmail.h
198 rcfile_y.o: rcfile_y.c rcfile_y.h config.h fetchmail.h
199
200 parser = $(srcdir)/rcfile_l.l $(srcdir)/rcfile_y.y
201 headers = $(srcdir)/fetchmail.h $(srcdir)/socket.h $(srcdir)/smtp.h \
202         $(srcdir)/mx.h $(srcdir)/md5.h $(srcdir)/md5global.h \
203         $(srcdir)/netrc.h $(srcdir)/tunable.h
204 extra = $(srcdir)/alloca.c $(srcdir)/getopt.[ch] $(srcdir)/getopt1.c \
205         $(srcdir)/strcasecmp.c $(srcdir)/strstr.c $(srcdir)/memmove.c
206 docs = $(srcdir)/COPYING $(srcdir)/FEATURES $(srcdir)/fetchmail-features.html \
207         $(srcdir)/design-notes.html $(srcdir)/NOTES \
208         $(srcdir)/INSTALL $(srcdir)/NEWS  $(srcdir)/README \
209         $(srcdir)/fetchmail.lsm $(srcdir)/sample.rcfile \
210         $(srcdir)/*.man $(srcdir)/FAQ $(srcdir)/fetchmail-FAQ.html
211 config = $(srcdir)/Makefile.in $(srcdir)/configure.in $(srcdir)/configure \
212         $(srcdir)/config.guess $(srcdir)/config.h.in $(srcdir)/config.sub \
213         $(srcdir)/acconfig.h
214 scripts = $(srcdir)/install.sh $(srcdir)/mkinstalldirs \
215         $(srcdir)/specgen.sh $(srcdir)/lsmgen.sh
216 all = $(docs) $(config) $(srcs) $(parser) $(headers) $(extra) $(scripts) \
217         $(srcdir)/contrib/*[A-Za-uw-z] $(srcdir)/MANIFEST
218
219 MANIFEST: $(srcdir) Makefile.in
220         @echo $(all) | tr "[ \t]" '\n' | sed -e '/^\.\//s///' | sort >MANIFEST
221         @wc -l MANIFEST
222
223 FAQ: fetchmail-FAQ.html
224         echo "   (This document was generated from fetchmail-FAQ.html)" >FAQ
225         lynx -dump -nolist fetchmail-FAQ.html >>FAQ
226
227 FEATURES: fetchmail-features.html
228         echo "   (This document was generated from fetchmail-features.html)" >FEATURES
229         lynx -dump -nolist fetchmail-features.html | grep -v "Back to " >>FEATURES
230
231 NOTES: design-notes.html
232         echo "   (This document was generated from design-notes.html)" >NOTES
233         lynx -dump -nolist design-notes.html | grep -v "Back to " >NOTES
234
235 # Make distribution, update LSM with proper size, remake distribution
236 dist: Makefile.in  
237         rm -f MANIFEST; make MANIFEST;
238         make fetchmail-$(VERS).tar.gz 
239         lsmgen.sh $(VERS) `wc -c fetchmail-$(VERS).tar.gz` >fetchmail.lsm
240         make fetchmail-$(VERS).tar.gz
241         ls -l fetchmail-$(VERS).tar.gz
242         @echo "Don't forget to build RPMs from root!"
243
244 # This requires my patch to tar-1.12, or a stock tar-1.13 (not yet released);
245 # the version must implement the --name-prefix option.
246 fetchmail-$(VERS).tar.gz: $(all)
247         tar --name-prefix='fetchmail-$(VERS)/' -czf fetchmail-$(VERS).tar.gz `cat MANIFEST`
248
249 # Make RPMs.  You need to be root to make this work
250 RPMROOT=/usr/src/redhat
251 RPM = rpm
252 RPMFLAGS = -ba
253 rpm: dist
254         cp fetchmail-$(VERS).tar.gz fetchmail.gif $(RPMROOT)/SOURCES;
255         $(srcdir)/specgen.sh $(VERS) >$(RPMROOT)/SPECS/fetchmail.spec
256         cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) fetchmail.spec  
257         cp $(RPMROOT)/RPMS/`arch|sed 's/i[4-9]86/i386/'`/fetchmail-$(VERS)*.rpm $(srcdir)
258         cp $(RPMROOT)/SRPMS/fetchmail-$(VERS)*.src.rpm $(srcdir)
259
260 # Automatically generated dependencies will be put at the end of the makefile.