]> Pileus Git - ~andy/fetchmail/blob - Makefile.in
Better compilation properties for AIX.
[~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=3.9.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 # 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 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 error.o
82
83 objs = $(protobjs) $(extras) $(EXTRAOBJ)
84
85 srcs = $(srcdir)/socket.c $(srcdir)/getpass.c $(srcdir)/pop2.c          \
86        $(srcdir)/pop3.c $(srcdir)/imap.c $(srcdir)/etrn.c               \
87        $(srcdir)/fetchmail.c $(srcdir)/options.c $(srcdir)/daemon.c     \
88        $(srcdir)/driver.c $(srcdir)/rfc822.c $(srcdir)/smtp.c           \
89        $(srcdir)/xmalloc.c $(srcdir)/uid.c $(srcdir)/mxget.c            \
90        $(srcdir)/md5c.c $(srcdir)/md5ify.c $(srcdir)/interface.c        \
91        $(srcdir)/netrc.c $(srcdir)/error.c
92
93 .SUFFIXES:
94 .SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi
95
96 all: fetchmail
97
98 # Some makes apparently use .PHONY as the default goal if it is before `all'.
99 .PHONY: all check
100
101 fetchmail: $(objs)
102         $(CC) $(LDFLAGS) $(objs) $(LOADLIBS) -o fetchmail
103
104 # Tester for address parsing
105 rfc822: rfc822.c
106         gcc -DTESTMAIN -g rfc822.c -o rfc822
107
108 # -I. is needed to find config.h in the build directory.
109 .c.o:
110         $(CC) $(defines) -c -I. -I$(srcdir) $(CFLAGS) $< $(OUTPUT_OPTION)
111
112 # lex rule
113 .l.o:
114         $(LEX) $(LEXFLAGS) $<
115         mv lex.yy.c $*.c
116         $(CC) $(defines) -c -I. -I$(srcdir) $(CFLAGS) $*.c $(OUTPUT_OPTION)
117
118 .l.c:
119         $(LEX) $(LEXFLAGS) $<
120         mv lex.yy.c $*.c
121
122 # yacc rule
123 .y.o:
124         $(YACC) $(YACCFLAGS) $<
125         mv y.tab.c $*.c
126         mv -f y.tab.h $*.h
127         $(CC) $(defines) -c -I. -I$(srcdir) $(CFLAGS) $*.c $(OUTPUT_OPTION)
128
129 .y.c:
130         $(YACC) $(YACCFLAGS) $<
131         mv y.tab.c $*.c
132         mv -f y.tab.h $*.h
133
134 # For some losing Unix makes.
135 SHELL = /bin/sh
136 MAKE = make
137
138 FORCE:
139
140 tagsrcs = $(srcs) $(srcdir)/rcfile_l.c $(srcdir)/rcfile_y.c
141 TAGS: $(tagsrcs)
142         $(ETAGS) $(tagsrcs)
143 tags: $(tagsrcs)
144         $(CTAGS) $(tagsrcs)
145
146 .PHONY: install installdirs
147 install: installdirs $(bindir)/$(instname) $(mandir)/$(instname).$(manext)
148
149 installdirs:
150         $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(mandir)
151
152 $(bindir)/$(instname): fetchmail
153         $(INSTALL_PROGRAM) fetchmail $@
154
155 $(mandir)/$(instname).$(manext): fetchmail.man
156         $(INSTALL_DATA) $(srcdir)/fetchmail.man $@
157
158 .PHONY: clean realclean distclean mostlyclean
159 clean: 
160         -rm -f fetchmail *.o core fetchmail.dvi \
161                rcfile_l.c rcfile_y.h rcfile_y.c \
162                fetchmail.tar fetchmail.tar.gz \
163                rfc822 FAQ
164
165 distclean: clean 
166         -rm -f Makefile config.h TAGS tags
167         -rm -f config.cache config.status config.log stamp-config
168         -rm -f fetchmail.log fetchmail.toc fetchmail.*aux
169
170 realclean: distclean # fetchmail.info*
171
172 mostlyclean: clean
173
174 Makefile: config.status $(srcdir)/Makefile.in
175         $(SHELL) config.status
176         @echo "You can ignore any makedepend error messages"
177         -makedepend -I. -fMakefile *.c
178
179 config.h: stamp-config 
180
181 stamp-config: config.status $(srcdir)/config.h.in
182         $(SHELL) config.status
183         touch stamp-config
184
185 configure: configure.in
186         autoconf $(ACFLAGS)
187
188 config.h.in: acconfig.h configure.in
189         autoheader $(ACFLAGS); touch config.h.in
190
191 # This tells versions [3.59,3.63) of GNU make not to export all variables.
192 .NOEXPORT:
193
194 # Special dependencies, not easily handled without explicit rules
195 $(srcdir)/rcfile_l.c $(srcdir)/rcfile_l.h: $(srcdir)/rcfile_l.l
196 $(srcdir)/rcfile_y.c $(srcdir)/rcfile_y.h: $(srcdir)/rcfile_y.y
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
204 docs = $(srcdir)/COPYING $(srcdir)/README $(srcdir)/INSTALL $(srcdir)/NEWS \
205         $(srcdir)/NOTES $(srcdir)/fetchmail.lsm $(srcdir)/sample.rcfile \
206         $(srcdir)/*.man $(srcdir)/FAQ $(srcdir)/fetchmail.FAQ.html
207 config = $(srcdir)/Makefile.in $(srcdir)/configure.in $(srcdir)/configure \
208         $(srcdir)/config.guess $(srcdir)/config.h.in $(srcdir)/config.sub \
209         $(srcdir)/acconfig.h
210 scripts = $(srcdir)/install.sh $(srcdir)/mkinstalldirs $(srcdir)/specgen.sh
211 all = $(docs) $(config) $(srcs) $(parser) $(headers) $(extra) $(scripts) \
212         $(srcdir)/contrib/* $(srcdir)/MANIFEST
213
214 MANIFEST: $(srcdir) Makefile.in
215         @echo $(all) | tr "[ \t]" '\n' | sort | sed "s/\\./fetchmail-$(VERS)/" >MANIFEST
216
217 FAQ: fetchmail.FAQ.html
218         lynx -dump -nolist fetchmail.FAQ.html >FAQ
219
220 dist: fetchmail-$(VERS).tar.gz
221         ls -l fetchmail-$(VERS).tar.gz
222
223 fetchmail-$(VERS).tar: $(all)
224         (cd ..; tar -cf fetchmail-$(VERS).tar `cat fetchmail-$(VERS)/MANIFEST`)
225         mv ../fetchmail-$(VERS).tar fetchmail-$(VERS).tar
226 fetchmail-$(VERS).tar.gz: fetchmail-$(VERS).tar
227         gzip -f fetchmail-$(VERS).tar
228
229 # You need to be root to make this work
230 RPMROOT=/usr/src/redhat
231 RPM = rpm
232 RPMFLAGS = -ba
233 rpm: fetchmail-$(VERS).tar.gz
234         cp fetchmail-$(VERS).tar.gz $(RPMROOT)/SOURCES;
235         $(srcdir)/specgen.sh $(VERS) $(PL) >$(RPMROOT)/SPECS/fetchmail.spec
236         cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) fetchmail.spec  
237         cp $(RPMROOT)/RPMS/i386/fetchmail-$(VERS)*.rpm $(srcdir)
238         cp $(RPMROOT)/SRPMS/fetchmail-$(VERS)*.src.rpm $(srcdir)
239
240 # The automatically generated dependencies below may omit config.h
241 # because it is included with ``#include <config.h>'' rather than
242 # ``#include "config.h"''.  So we add the explicit dependency to make sure.
243 $(objs): config.h
244
245 rcfile_l.o: rcfile_y.h
246
247 # Automatically generated dependencies will be put at the end of the makefile.
248 # DO NOT DELETE THIS LINE -- make depend depends on it.