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