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