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