Increase the testrun timeout for slow compilefarm systems.
[rsync/rsync.git] / Makefile.in
1 # Makefile for rsync. This is processed by configure to produce the final
2 # Makefile
3
4 prefix=@prefix@
5 datarootdir=@datarootdir@
6 exec_prefix=@exec_prefix@
7 bindir=@bindir@
8 mandir=@mandir@
9
10 LIBS=@LIBS@
11 CC=@CC@
12 CFLAGS=@CFLAGS@
13 CPPFLAGS=@CPPFLAGS@
14 EXEEXT=@EXEEXT@
15 LDFLAGS=@LDFLAGS@
16
17 INSTALLCMD=@INSTALL@
18 INSTALLMAN=@INSTALL@
19
20 srcdir=@srcdir@
21 VPATH=$(srcdir)
22 SHELL=/bin/sh
23
24 VERSION=@VERSION@
25
26 .SUFFIXES:
27 .SUFFIXES: .c .o
28
29 GENFILES=configure.sh config.h.in proto.h proto.h-tstamp rsync.1 rsyncd.conf.5
30 HEADERS=byteorder.h config.h errcode.h proto.h rsync.h ifuncs.h itypes.h inums.h \
31         lib/pool_alloc.h
32 LIBOBJ=lib/wildmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o lib/md5.o \
33         lib/permstring.o lib/pool_alloc.o lib/sysacls.o lib/sysxattrs.o @LIBOBJS@
34 ZLIBOBJ=zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o \
35         zlib/trees.o zlib/zutil.o zlib/adler32.o zlib/compress.o zlib/crc32.o
36 OBJS1=flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o \
37         util.o main.o checksum.o match.o syscall.o log.o backup.o delete.o
38 OBJS2=options.o io.o compat.o hlink.o token.o uidlist.o socket.o hashtable.o \
39         fileio.o batch.o clientname.o chmod.o acls.o xattrs.o
40 OBJS3=progress.o pipe.o
41 DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
42 popt_OBJS=popt/findme.o  popt/popt.o  popt/poptconfig.o \
43         popt/popthelp.o popt/poptparse.o
44 OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) $(ZLIBOBJ) @BUILD_POPT@
45
46 TLS_OBJ = tls.o syscall.o lib/compat.o lib/snprintf.o lib/permstring.o lib/sysxattrs.o @BUILD_POPT@
47
48 # Programs we must have to run the test cases
49 CHECK_PROGS = rsync$(EXEEXT) tls$(EXEEXT) getgroups$(EXEEXT) getfsdev$(EXEEXT) \
50         testrun$(EXEEXT) trimslash$(EXEEXT) t_unsafe$(EXEEXT) wildtest$(EXEEXT)
51
52 CHECK_SYMLINKS = testsuite/chown-fake.test testsuite/devices-fake.test
53
54 # Objects for CHECK_PROGS to clean
55 CHECK_OBJS=tls.o testrun.o getgroups.o getfsdev.o t_stub.o t_unsafe.o trimslash.o wildtest.o
56
57 # note that the -I. is needed to handle config.h when using VPATH
58 .c.o:
59 @OBJ_SAVE@
60         $(CC) -I. -I$(srcdir) $(CFLAGS) $(CPPFLAGS) -c $< @CC_SHOBJ_FLAG@
61 @OBJ_RESTORE@
62
63 all: Makefile rsync$(EXEEXT) @MAKE_MAN@
64
65 install: all
66         -mkdir -p ${DESTDIR}${bindir}
67         ${INSTALLCMD} ${INSTALL_STRIP} -m 755 rsync$(EXEEXT) ${DESTDIR}${bindir}
68         -mkdir -p ${DESTDIR}${mandir}/man1
69         -mkdir -p ${DESTDIR}${mandir}/man5
70         if test -f rsync.1; then ${INSTALLMAN} -m 644 rsync.1 ${DESTDIR}${mandir}/man1; fi
71         if test -f rsyncd.conf.5; then ${INSTALLMAN} -m 644 rsyncd.conf.5 ${DESTDIR}${mandir}/man5; fi
72
73 install-strip:
74         $(MAKE) INSTALL_STRIP='-s' install
75
76 rsync$(EXEEXT): $(OBJS)
77         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
78
79 $(OBJS): $(HEADERS)
80 $(CHECK_OBJS): $(HEADERS)
81
82 flist.o: rounding.h
83
84 rounding.h: rounding.c rsync.h
85         @for r in 0 1 3; do \
86             if $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o rounding -DEXTRA_ROUNDING=$$r -I. $(srcdir)/rounding.c >rounding.out 2>&1; then \
87                 echo "#define EXTRA_ROUNDING $$r" >rounding.h; \
88                 if test -f "$$HOME/build_farm/build_test.fns"; then \
89                     echo "EXTRA_ROUNDING is $$r" >&2; \
90                 fi; \
91                 break; \
92             fi; \
93         done
94         @rm -f rounding
95         @if test -f rounding.h; then : ; else \
96             cat rounding.out 1>&2; \
97             echo "Failed to create rounding.h!" 1>&2; \
98             exit 1; \
99         fi
100         @rm -f rounding.out
101
102 tls$(EXEEXT): $(TLS_OBJ)
103         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TLS_OBJ) $(LIBS)
104
105 testrun$(EXEEXT): testrun.o
106         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ testrun.o
107
108 getgroups$(EXEEXT): getgroups.o
109         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getgroups.o $(LIBS)
110
111 getfsdev$(EXEEXT): getfsdev.o
112         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getfsdev.o $(LIBS)
113
114 TRIMSLASH_OBJ = trimslash.o syscall.o lib/compat.o lib/snprintf.o
115 trimslash$(EXEEXT): $(TRIMSLASH_OBJ)
116         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TRIMSLASH_OBJ) $(LIBS)
117
118 T_UNSAFE_OBJ = t_unsafe.o syscall.o util.o t_stub.o lib/compat.o lib/snprintf.o lib/wildmatch.o
119 t_unsafe$(EXEEXT): $(T_UNSAFE_OBJ)
120         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(T_UNSAFE_OBJ) $(LIBS)
121
122 gen: conf proto.h man
123
124 gensend: gen
125         rsync -aivzc $(GENFILES) samba.org:/home/ftp/pub/rsync/generated-files/
126
127 conf:
128         cd $(srcdir) && $(MAKE) -f prepare-source.mak conf
129
130 configure.sh config.h.in: configure.in aclocal.m4
131         @if test -f configure.sh; then cp -p configure.sh configure.sh.old; else touch configure.sh.old; fi
132         @if test -f config.h.in; then cp -p config.h.in config.h.in.old; else touch config.h.in.old; fi
133         autoconf -o configure.sh
134         autoheader && touch config.h.in
135         @if diff configure.sh configure.sh.old >/dev/null 2>&1; then \
136             echo "configure.sh is unchanged."; \
137             rm configure.sh.old; \
138         else \
139             echo "configure.sh has CHANGED."; \
140         fi
141         @if diff config.h.in config.h.in.old >/dev/null 2>&1; then \
142             echo "config.h.in is unchanged."; \
143             rm config.h.in.old; \
144         else \
145             echo "config.h.in has CHANGED."; \
146         fi
147         @if test -f configure.sh.old -o -f config.h.in.old; then \
148             if test "$(MAKECMDGOALS)" = reconfigure; then \
149                 echo 'Continuing with "make reconfigure".'; \
150             else \
151                 echo 'You may need to run:'; \
152                 echo '  make reconfigure'; \
153                 exit 1; \
154             fi \
155         fi
156
157 reconfigure: configure.sh
158         ./config.status --recheck
159         ./config.status
160
161 Makefile: Makefile.in config.status configure.sh config.h.in
162         @if test -f Makefile; then cp -p Makefile Makefile.old; else touch Makefile.old; fi
163         @./config.status
164         @if diff Makefile Makefile.old >/dev/null 2>&1; then \
165             echo "Makefile is unchanged."; \
166             rm Makefile.old; \
167         else \
168             if test "$(MAKECMDGOALS)" = reconfigure; then \
169                 echo 'Continuing with "make reconfigure".'; \
170             else \
171                 echo "Makefile updated -- rerun your make command."; \
172                 exit 1; \
173             fi \
174         fi
175
176 proto: proto.h-tstamp
177
178 proto.h: proto.h-tstamp
179         @if test -f proto.h; then :; else cp -p $(srcdir)/proto.h .; fi
180
181 proto.h-tstamp: $(srcdir)/*.c $(srcdir)/lib/compat.c config.h
182         perl $(srcdir)/mkproto.pl $(srcdir)/*.c $(srcdir)/lib/compat.c
183
184 man: rsync.1 rsyncd.conf.5
185         @if test -f rsync.1; then :; else cp -p $(srcdir)/rsync.1 .; fi
186         @if test -f rsyncd.conf.5; then :; else cp -p $(srcdir)/rsyncd.conf.5 .; fi
187
188 rsync.1: rsync.yo
189         yodl2man -o rsync.1 $(srcdir)/rsync.yo
190         -$(srcdir)/tweak_manpage rsync.1
191
192 rsyncd.conf.5: rsyncd.conf.yo
193         yodl2man -o rsyncd.conf.5 $(srcdir)/rsyncd.conf.yo
194         -$(srcdir)/tweak_manpage rsyncd.conf.5
195
196 clean: cleantests
197         rm -f *~ $(OBJS) $(CHECK_PROGS) $(CHECK_OBJS) $(CHECK_SYMLINKS) \
198                 rounding rounding.h *.old
199
200 cleantests:
201         rm -rf ./testtmp*
202
203 # We try to delete built files from both the source and build
204 # directories, just in case somebody previously configured things in
205 # the source directory.
206 distclean: clean
207         rm -f Makefile config.h config.status
208         rm -f lib/dummy popt/dummy zlib/dummy
209         rm -f $(srcdir)/Makefile $(srcdir)/config.h $(srcdir)/config.status
210         rm -f $(srcdir)/lib/dummy $(srcdir)/popt/dummy $(srcdir)/zlib/dummy
211         rm -f config.cache config.log
212         rm -f $(srcdir)/config.cache $(srcdir)/config.log
213         rm -f shconfig $(srcdir)/shconfig
214         rm -f $(GENFILES)
215         rm -rf autom4te.cache
216
217 # this target is really just for my use. It only works on a limited
218 # range of machines and is used to produce a list of potentially
219 # dead (ie. unused) functions in the code. (tridge)
220 finddead:
221         nm *.o */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt
222         nm *.o */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt
223         comm -13 nmused.txt nmfns.txt
224
225 # 'check' is the GNU name, 'test' is the name for everybody else :-)
226 .PHONY: check test
227
228 test: check
229
230 # There seems to be no standard way to specify some variables as
231 # exported from a Makefile apart from listing them like this.
232
233 # This depends on building rsync; if we need any helper programs it
234 # should depend on them too.
235
236 # We try to run the scripts with POSIX mode on, in the hope that will
237 # catch Bash-isms earlier even if we're running on GNU.  Of course, we
238 # might lose in the future where POSIX diverges from old sh.
239
240 check: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
241         rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh
242
243 check29: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
244         rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh --protocol=29
245
246 check30: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
247         rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh --protocol=30
248
249 wildtest.o: wildtest.c lib/wildmatch.c rsync.h config.h
250 wildtest$(EXEEXT): wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@
251         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@ $(LIBS)
252
253 testsuite/chown-fake.test:
254         ln -s chown.test $(srcdir)/testsuite/chown-fake.test
255
256 testsuite/devices-fake.test:
257         ln -s devices.test $(srcdir)/testsuite/devices-fake.test
258
259 # This does *not* depend on building or installing: you can use it to
260 # check a version installed from a binary or some other source tree,
261 # if you want.
262
263 installcheck: $(CHECK_PROGS) $(CHECK_SYMLINKS)
264         POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin="$(bindir)/rsync$(EXEEXT)" srcdir="$(srcdir)" $(srcdir)/runtests.sh
265
266 # TODO: Add 'dist' target; need to know which files will be included
267
268 # Run the SPLINT (Secure Programming Lint) tool.  <www.splint.org>
269 .PHONY: splint
270 splint:
271         splint +unixlib +gnuextensions -weak rsync.c
272
273
274 rsync.dvi: doc/rsync.texinfo
275         texi2dvi -o $@ $<
276
277 rsync.ps: rsync.dvi
278         dvips -ta4 -o $@ $<
279
280 rsync.pdf: doc/rsync.texinfo
281         texi2dvi -o $@ --pdf $<
282
283
284 doxygen:
285         cd $(srcdir) && rm dox/html/* && doxygen
286
287 # for maintainers only
288 doxygen-upload:
289         rsync -avzv $(srcdir)/dox/html/ --delete \
290         samba.org:/home/httpd/html/rsync/doxygen/head/