1 # Makefile for rsync. This is processed by configure to produce the final
5 datarootdir
=@datarootdir@
6 exec_prefix=@
exec_prefix@
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 lib
/pool_alloc.h
31 LIBOBJ
=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@
33 ZLIBOBJ
=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
35 OBJS1
=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
37 OBJS2
=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
39 OBJS3
=progress.o pipe.o
40 DAEMON_OBJ
= params.o loadparm.o clientserver.o access.o connection.o authenticate.o
41 popt_OBJS
=popt
/findme.o popt
/popt.o popt
/poptconfig.o \
42 popt
/popthelp.o popt
/poptparse.o
43 OBJS
=$(OBJS1
) $(OBJS2
) $(OBJS3
) $(DAEMON_OBJ
) $(LIBOBJ
) $(ZLIBOBJ
) @BUILD_POPT@
45 TLS_OBJ
= tls.o syscall.o lib
/compat.o lib
/snprintf.o lib
/permstring.o lib
/sysxattrs.o @BUILD_POPT@
47 # Programs we must have to run the test cases
48 CHECK_PROGS
= rsync
$(EXEEXT
) tls
$(EXEEXT
) getgroups
$(EXEEXT
) getfsdev
$(EXEEXT
) \
49 trimslash
$(EXEEXT
) t_unsafe
$(EXEEXT
) wildtest
$(EXEEXT
)
51 CHECK_SYMLINKS
= testsuite
/chown-fake.
test testsuite
/devices-fake.
test
53 # Objects for CHECK_PROGS to clean
54 CHECK_OBJS
=tls.o getgroups.o getfsdev.o t_stub.o t_unsafe.o trimslash.o wildtest.o
56 # note that the -I. is needed to handle config.h when using VPATH
59 $(CC
) -I.
-I
$(srcdir) $(CFLAGS
) $(CPPFLAGS
) -c
$< @CC_SHOBJ_FLAG@
62 all: conf_stop make_stop rsync
$(EXEEXT
) @MAKE_MAN@
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 rsync
.1; then
${INSTALLMAN} -m
644 rsync
.1 ${DESTDIR}${mandir}/man1
; fi
70 if
test -f rsyncd.conf
.5; then
${INSTALLMAN} -m
644 rsyncd.conf
.5 ${DESTDIR}${mandir}/man5
; fi
73 $(MAKE
) INSTALL_STRIP
='-s' install
75 rsync
$(EXEEXT
): $(OBJS
)
76 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$(OBJS
) $(LIBS
)
79 $(CHECK_OBJS
): $(HEADERS
)
83 rounding.h
: rounding.c rsync.h
85 if
$(CC
) $(CFLAGS
) $(CPPFLAGS
) $(LDFLAGS
) -o rounding
-DEXTRA_ROUNDING
=$$r -I.
$(srcdir)/rounding.c
>rounding.out
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; \
94 @if
test -f rounding.h
; then
: ; else \
95 cat rounding.out
1>&2; \
96 echo
"Failed to create rounding.h!" 1>&2; \
101 tls
$(EXEEXT
): $(TLS_OBJ
)
102 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$(TLS_OBJ
) $(LIBS
)
104 getgroups
$(EXEEXT
): getgroups.o
105 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@ getgroups.o
$(LIBS
)
107 getfsdev
$(EXEEXT
): getfsdev.o
108 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@ getfsdev.o
$(LIBS
)
110 TRIMSLASH_OBJ
= trimslash.o syscall.o lib
/compat.o lib
/snprintf.o
111 trimslash
$(EXEEXT
): $(TRIMSLASH_OBJ
)
112 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$(TRIMSLASH_OBJ
) $(LIBS
)
114 T_UNSAFE_OBJ
= t_unsafe.o syscall.o util.o t_stub.o lib
/compat.o lib
/snprintf.o lib
/wildmatch.o
115 t_unsafe
$(EXEEXT
): $(T_UNSAFE_OBJ
)
116 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$(T_UNSAFE_OBJ
) $(LIBS
)
118 gen
: conf proto.h man
121 rsync
-aivzc
$(GENFILES
) samba.org
:/home
/ftp
/pub
/rsync
/generated-files
/
124 cd
$(srcdir) && $(MAKE
) -f prepare-source.mak conf
126 conf_stop
: configure.sh config.h.in
128 configure.sh config.h.in
: configure.in aclocal.m4
129 autoconf
-o configure.sh
130 autoheader
&& touch config.h.in
131 @echo
'Configure files changed -- perhaps run:'
132 @echo
' make reconfigure'
135 reconfigure
: configure.sh
136 .
/config.status
--recheck
141 Makefile
: Makefile.in config.status
143 @echo
"Makefile updated -- rerun your make command."
146 proto
: proto.h-tstamp
148 proto.h
: proto.h-tstamp
149 @if
test -f proto.h
; then
:; else cp
-p
$(srcdir)/proto.h .
; fi
151 proto.h-tstamp
: $(srcdir)/*.c
$(srcdir)/lib
/compat.c
152 perl
$(srcdir)/mkproto.pl
$(srcdir)/*.c
$(srcdir)/lib
/compat.c
154 man
: rsync
.1 rsyncd.conf
.5
155 @if
test -f rsync
.1; then
:; else cp
-p
$(srcdir)/rsync
.1 .
; fi
156 @if
test -f rsyncd.conf
.5; then
:; else cp
-p
$(srcdir)/rsyncd.conf
.5 .
; fi
159 yodl2man
-o rsync
.1 $(srcdir)/rsync.yo
160 -$(srcdir)/tweak_manpage rsync
.1
162 rsyncd.conf
.5: rsyncd.conf.yo
163 yodl2man
-o rsyncd.conf
.5 $(srcdir)/rsyncd.conf.yo
164 -$(srcdir)/tweak_manpage rsyncd.conf
.5
167 rm -f
*~
$(OBJS
) $(CHECK_PROGS
) $(CHECK_OBJS
) $(CHECK_SYMLINKS
) \
173 # We try to delete built files from both the source and build
174 # directories, just in case somebody previously configured things in
175 # the source directory.
177 rm -f Makefile config.h config.status
178 rm -f lib
/dummy popt
/dummy zlib
/dummy
179 rm -f
$(srcdir)/Makefile
$(srcdir)/config.h
$(srcdir)/config.status
180 rm -f
$(srcdir)/lib
/dummy
$(srcdir)/popt
/dummy
$(srcdir)/zlib
/dummy
181 rm -f config.cache config.log
182 rm -f
$(srcdir)/config.cache
$(srcdir)/config.log
183 rm -f shconfig
$(srcdir)/shconfig
185 rm -rf autom4te.cache
187 # this target is really just for my use. It only works on a limited
188 # range of machines and is used to produce a list of potentially
189 # dead (ie. unused) functions in the code. (tridge)
191 nm
*.o
*/*.o |grep
'U ' | awk
'{print $$2}' |
sort -u
> nmused.txt
192 nm
*.o
*/*.o |grep
'T ' | awk
'{print $$3}' |
sort -u
> nmfns.txt
193 comm
-13 nmused.txt nmfns.txt
195 # 'check' is the GNU name, 'test' is the name for everybody else :-)
200 # There seems to be no standard way to specify some variables as
201 # exported from a Makefile apart from listing them like this.
203 # This depends on building rsync; if we need any helper programs it
204 # should depend on them too.
206 # We try to run the scripts with POSIX mode on, in the hope that will
207 # catch Bash-isms earlier even if we're running on GNU. Of course, we
208 # might lose in the future where POSIX diverges from old sh.
210 check: all $(CHECK_PROGS
) $(CHECK_SYMLINKS
)
211 rsync_bin
=`pwd`/rsync
$(EXEEXT
) $(srcdir)/runtests.sh
213 check29
: all $(CHECK_PROGS
) $(CHECK_SYMLINKS
)
214 rsync_bin
=`pwd`/rsync
$(EXEEXT
) $(srcdir)/runtests.sh
--protocol
=29
216 wildtest.o
: wildtest.c lib
/wildmatch.c rsync.h config.h
217 wildtest
$(EXEEXT
): wildtest.o lib
/compat.o lib
/snprintf.o @BUILD_POPT@
218 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@ wildtest.o lib
/compat.o lib
/snprintf.o @BUILD_POPT@
$(LIBS
)
220 testsuite
/chown-fake.
test:
221 ln
-s chown.
test $(srcdir)/testsuite
/chown-fake.
test
223 testsuite
/devices-fake.
test:
224 ln
-s devices.
test $(srcdir)/testsuite
/devices-fake.
test
226 # This does *not* depend on building or installing: you can use it to
227 # check a version installed from a binary or some other source tree,
230 installcheck: $(CHECK_PROGS
) $(CHECK_SYMLINKS
)
231 POSIXLY_CORRECT
=1 TOOLDIR
=`pwd` rsync_bin
="$(bindir)/rsync$(EXEEXT)" srcdir="$(srcdir)" $(srcdir)/runtests.sh
233 # TODO: Add 'dist' target; need to know which files will be included
235 # Run the SPLINT (Secure Programming Lint) tool. <www.splint.org>
238 splint
+unixlib
+gnuextensions
-weak rsync.c
241 rsync.
dvi: doc
/rsync.texinfo
247 rsync.pdf
: doc
/rsync.texinfo
248 texi2dvi -o
$@
--pdf
$<
252 cd
$(srcdir) && rm dox
/html
/* && doxygen
254 # for maintainers only
256 rsync
-avzv
$(srcdir)/dox
/html
/ --delete \
257 samba.org
:/home
/httpd
/html
/rsync
/doxygen
/head
/