]> Pileus Git - ~andy/fetchmail/blob - Makefile.in
Ready to ship.
[~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.6.2
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 # Directory in which to install.
57 bindir = @bindir@
58 # Directory to install the Info files in.
59 infodir = @infodir@
60 # Number to put on the man page filename.
61 manext = 1
62 # Directory to install the man page in.
63 mandir = @mandir@/man$(manext)
64
65 # Program to install `make'.
66 INSTALL_PROGRAM = @INSTALL_PROGRAM@
67 # Program to install the man page.
68 INSTALL_DATA = @INSTALL_DATA@
69 # Generic install program.
70 INSTALL = @INSTALL@
71
72 # Program to format Texinfo source into Info files.
73 MAKEINFO = makeinfo
74 # Program to format Texinfo source into DVI files.
75 TEXI2DVI = texi2dvi
76
77 # Programs to make tags files.
78 ETAGS = etags
79 CTAGS = ctags
80
81 protobjs = rcfile_y.o rcfile_l.o socket.o getpass.o pop2.o pop3.o imap.o \
82        etrn.o fetchmail.o env.o options.o daemon.o driver.o sink.o \
83        rfc822.o smtp.o xmalloc.o uid.o mxget.o md5c.o md5ify.o rpa.o \
84        interface.o netrc.o base64.o error.o unmime.o conf.o checkalias.o
85
86 objs = $(protobjs) $(extras) $(EXTRAOBJ)
87
88 srcs = $(srcdir)/socket.c $(srcdir)/getpass.c $(srcdir)/pop2.c          \
89        $(srcdir)/pop3.c $(srcdir)/imap.c $(srcdir)/etrn.c               \
90        $(srcdir)/fetchmail.c $(srcdir)/env.c                            \
91        $(srcdir)/options.c $(srcdir)/daemon.c $(srcdir)/driver.c        \
92        $(srcdir)/sink.c $(srcdir)/rfc822.c $(srcdir)/smtp.c             \
93        $(srcdir)/xmalloc.c $(srcdir)/uid.c $(srcdir)/mxget.c            \
94        $(srcdir)/md5c.c $(srcdir)/md5ify.c $(srcdir)/rpa.c              \
95        $(srcdir)/interface.c $(srcdir)/netrc.c $(srcdir)/base64.c       \
96        $(srcdir)/error.c $(srcdir)/unmime.c $(srcdir)/conf.c            \
97        $(srcdir)/checkalias.c
98
99 .SUFFIXES:
100 .SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi
101
102 all: fetchmail
103
104 # Some makes apparently use .PHONY as the default goal if it is before `all'.
105 .PHONY: all
106
107 fetchmail: $(objs)
108         $(CC) $(LDEFLAGS) $(LDFLAGS) $(objs) $(LOADLIBS) -o fetchmail
109
110 # Tester for address parsing
111 rfc822: rfc822.c
112         gcc -DTESTMAIN -g rfc822.c -o rfc822
113
114 # Stand-alone MIME decoder
115 unmime: unmime.c base64.c rfc822.c xmalloc.c error.c memmove.c
116         $(CC) -DSTANDALONE -g -o $@ $^ 
117
118 .c.o:
119         $(CC) $(defines) -c -I$(srcdir) -I. $(CEFLAGS) $(CFLAGS) $<
120
121 # For some losing Unix makes.
122 SHELL = /bin/sh
123 MAKE = make
124
125 tagsrcs = $(srcs) rcfile_l.c rcfile_y.c
126 TAGS: $(tagsrcs)
127         $(ETAGS) $(tagsrcs)
128 tags: $(tagsrcs)
129         $(CTAGS) $(tagsrcs)
130
131 .PHONY: install uninstall
132 install:
133         @echo "Creating installation directories..." 
134         $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(mandir)
135         @echo "Installing fetchmail binary..."
136         $(INSTALL_PROGRAM) ./fetchmail $(bindir)/fetchmail
137         @echo "Installing fetchmail configurator..."
138         $(INSTALL_PROGRAM) ${srcdir}/fetchmailconf $(bindir)/fetchmailconf
139         @echo "Installing manual page..."
140         $(INSTALL_DATA) $(srcdir)/fetchmail.man $(mandir)/fetchmail.$(manext)
141         ln -f -s $(mandir)/fetchmail.$(manext) $(mandir)/fetchmailconf.$(manext)
142
143 uninstall:
144         rm -f $(bindir)/fetchmail $(bindir)/fetchmailconf
145         rm -f $(mandir)/fetchmail.$(manext) $(mandir)/fetchmailconf.$(manext)
146
147 .PHONY: clean realclean distclean mostlyclean
148 clean: 
149         -rm -f fetchmail *.o core fetchmail.dvi \
150                rcfile_l.c rcfile_y.h rcfile_y.c \
151                fetchmail.tar fetchmail.tar.gz \
152                rfc822 unmime
153
154 distclean: clean 
155         -rm -f Makefile config.h TAGS tags
156         -rm -f config.cache config.status config.log stamp-config
157
158 realclean: distclean
159         -rm -f FAQ FEATURES NOTES MANIFEST 
160         -rm -f config.cache config.log Makefile
161         -rm -f fetchmail-*.tar.gz fetchmail-*.i386.rpm 
162
163 mostlyclean: clean
164
165 config.status: configure
166         $(srcdir)/configure
167
168 config.h: config.status config.h.in
169         sh config.status; touch config.h
170
171 Makefile: config.status Makefile.in
172         sh config.status
173
174 configure: configure.in
175         autoconf $(ACFLAGS)
176
177 config.h.in: acconfig.h configure.in
178         autoheader $(ACFLAGS); touch config.h.in
179
180 # This tells versions [3.59,3.63) of GNU make not to export all variables.
181 .NOEXPORT:
182
183 # Special dependencies, not easily handled portably without explicit rules
184 rcfile_l.c rcfile_l.h: $(srcdir)/rcfile_l.l
185         $(LEX) $(LEXFLAGS) $(srcdir)/rcfile_l.l
186         mv lex.yy.c rcfile_l.c
187 rcfile_y.c rcfile_y.h: $(srcdir)/rcfile_y.y
188         @echo "expect conflicts:  2 shift/reduce"
189         $(YACC) $(YACCFLAGS) $(srcdir)/rcfile_y.y
190         mv y.tab.c rcfile_y.c
191         mv -f y.tab.h rcfile_y.h
192
193 # These must be explicit, because the .c files often don't exist at
194 # makefile build time. 
195 rcfile_l.o: rcfile_y.c rcfile_y.h config.h fetchmail.h
196 rcfile_y.o: rcfile_y.c rcfile_y.h config.h fetchmail.h
197
198 parser = $(srcdir)/rcfile_l.l $(srcdir)/rcfile_y.y
199 headers = $(srcdir)/fetchmail.h $(srcdir)/socket.h $(srcdir)/smtp.h \
200         $(srcdir)/mx.h $(srcdir)/md5.h $(srcdir)/md5global.h \
201         $(srcdir)/netrc.h $(srcdir)/tunable.h
202 extra = $(srcdir)/alloca.c $(srcdir)/getopt.[ch] $(srcdir)/getopt1.c \
203         $(srcdir)/strcasecmp.c $(srcdir)/strstr.c $(srcdir)/memmove.c
204 docs = $(srcdir)/COPYING $(srcdir)/FEATURES $(srcdir)/fetchmail-features.html \
205         $(srcdir)/design-notes.html $(srcdir)/NOTES \
206         $(srcdir)/INSTALL $(srcdir)/NEWS  $(srcdir)/README \
207         $(srcdir)/fetchmail.lsm $(srcdir)/sample.rcfile \
208         $(srcdir)/*.man $(srcdir)/FAQ $(srcdir)/fetchmail-FAQ.html
209 config = $(srcdir)/Makefile.in $(srcdir)/configure.in $(srcdir)/configure \
210         $(srcdir)/config.guess $(srcdir)/config.h.in $(srcdir)/config.sub \
211         $(srcdir)/acconfig.h
212 scripts = $(srcdir)/install.sh $(srcdir)/mkinstalldirs \
213         $(srcdir)/specgen.sh $(srcdir)/lsmgen.sh $(srcdir)/fetchmailconf
214 all = $(docs) $(config) $(srcs) $(parser) $(headers) $(extra) $(scripts) \
215         $(srcdir)/rh-config/* $(srcdir)/contrib/*[A-Za-uw-z] $(srcdir)/MANIFEST
216
217 MANIFEST: $(srcdir) Makefile.in
218         @echo $(all) | tr "[ \t]" '\n' | sed -e '/^\.\//s///' | sort >MANIFEST
219         @wc -l MANIFEST
220
221 FAQ: fetchmail-FAQ.html
222         echo "   (This document was generated from fetchmail-FAQ.html)" >FAQ
223         lynx -dump -nolist fetchmail-FAQ.html >>FAQ
224
225 FEATURES: fetchmail-features.html
226         echo "   (This document was generated from fetchmail-features.html)" >FEATURES
227         lynx -dump -nolist fetchmail-features.html | grep -v "Back to " >>FEATURES
228
229 NOTES: design-notes.html
230         echo "   (This document was generated from design-notes.html)" >NOTES
231         lynx -dump -nolist design-notes.html | grep -v "Back to " >NOTES
232
233 # Make distribution, update LSM with proper size, remake distribution
234 dist: Makefile.in  
235         rm -f MANIFEST; make MANIFEST;
236         touch fetchmail.lsm
237         make fetchmail-$(VERS).tar.gz 
238         lsmgen.sh $(VERS) `wc -c fetchmail-$(VERS).tar.gz` >fetchmail.lsm
239         make fetchmail-$(VERS).tar.gz
240         ls -l fetchmail-$(VERS).tar.gz
241         @echo "Don't forget to build RPMs from root!"
242
243 fetchmail-$(VERS).tar.gz: $(all)
244         (cd ..; ln -sf fetchmail fetchmail-$(VERS))
245         (cd ..; tar -czf fetchmail-$(VERS).tar.gz `sed <fetchmail-$(VERS)/MANIFEST s:^:fetchmail-$(VERS)/:`)
246         mv ../fetchmail-$(VERS).tar.gz .
247         rm ../fetchmail-$(VERS)
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 # The following sets edit modes for GNU EMACS.
261 # Local Variables:
262 # compile-command:"configure"
263 # End:
264
265 # Automatically generated dependencies will be put at the end of the makefile.