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