1 # Makefile for rsync. This is processed by configure to produce the final
5 datarootdir
=@datarootdir@
6 exec_prefix=@
exec_prefix@
29 HEADERS
=byteorder.h config.h errcode.h proto.h rsync.h ifuncs.h lib
/pool_alloc.h
30 LIBOBJ
=lib
/wildmatch.o lib
/compat.o lib
/snprintf.o lib
/mdfour.o lib
/md5.o \
31 lib
/permstring.o lib
/pool_alloc.o lib
/sysacls.o lib
/sysxattrs.o @LIBOBJS@
32 ZLIBOBJ
=zlib
/deflate.o zlib
/inffast.o zlib
/inflate.o zlib
/inftrees.o \
33 zlib
/trees.o zlib
/zutil.o zlib
/adler32.o zlib
/compress.o zlib
/crc32.o
34 OBJS1
=flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o \
35 util.o main.o checksum.o match.o syscall.o log.o backup.o
36 OBJS2
=options.o io.o compat.o hlink.o token.o uidlist.o socket.o hashtable.o \
37 fileio.o batch.o clientname.o chmod.o acls.o xattrs.o
38 OBJS3
=progress.o pipe.o
39 DAEMON_OBJ
= params.o loadparm.o clientserver.o access.o connection.o authenticate.o
40 popt_OBJS
=popt
/findme.o popt
/popt.o popt
/poptconfig.o \
41 popt
/popthelp.o popt
/poptparse.o
42 OBJS
=$(OBJS1
) $(OBJS2
) $(OBJS3
) $(DAEMON_OBJ
) $(LIBOBJ
) $(ZLIBOBJ
) @BUILD_POPT@
44 TLS_OBJ
= tls.o syscall.o lib
/compat.o lib
/snprintf.o lib
/permstring.o lib
/sysxattrs.o @BUILD_POPT@
46 # Programs we must have to run the test cases
47 CHECK_PROGS
= rsync
$(EXEEXT
) tls
$(EXEEXT
) getgroups
$(EXEEXT
) getfsdev
$(EXEEXT
) \
48 trimslash
$(EXEEXT
) t_unsafe
$(EXEEXT
) wildtest
$(EXEEXT
)
50 CHECK_SYMLINKS
= testsuite
/chown-fake.
test testsuite
/devices-fake.
test
52 # Objects for CHECK_PROGS to clean
53 CHECK_OBJS
=getgroups.o getfsdev.o t_stub.o t_unsafe.o trimslash.o wildtest.o
55 # note that the -I. is needed to handle config.h when using VPATH
58 $(CC
) -I.
-I
$(srcdir) $(CFLAGS
) $(CPPFLAGS
) -c
$< @CC_SHOBJ_FLAG@
64 -mkdir
-p
${DESTDIR}${bindir}
65 ${INSTALLCMD} ${INSTALL_STRIP} -m
755 rsync
$(EXEEXT
) ${DESTDIR}${bindir}
66 -mkdir
-p
${DESTDIR}${mandir}/man1
67 -mkdir
-p
${DESTDIR}${mandir}/man5
68 ${INSTALLMAN} -m
644 $(srcdir)/rsync
.1 ${DESTDIR}${mandir}/man1
69 ${INSTALLMAN} -m
644 $(srcdir)/rsyncd.conf
.5 ${DESTDIR}${mandir}/man5
72 $(MAKE
) INSTALL_STRIP
='-s' install
74 rsync
$(EXEEXT
): $(OBJS
)
75 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$(OBJS
) $(LIBS
)
81 rounding.h
: mkrounding
$(EXEEXT
)
82 .
/mkrounding
$(EXEEXT
) >rounding.h
84 mkrounding
$(EXEEXT
): mkrounding.c rsync.h
85 @sed
'1,/^struct file_struct/d; /^}/,$$d' <$(srcdir)/rsync.h
>mkrounding.h
86 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
-I.
$(srcdir)/mkrounding.c
89 tls
$(EXEEXT
): $(TLS_OBJ
)
90 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$(TLS_OBJ
) $(LIBS
)
92 getgroups
$(EXEEXT
): getgroups.o
93 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@ getgroups.o
$(LIBS
)
95 getfsdev
$(EXEEXT
): getfsdev.o
96 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@ getfsdev.o
$(LIBS
)
98 TRIMSLASH_OBJ
= trimslash.o syscall.o lib
/compat.o lib
/snprintf.o
99 trimslash
$(EXEEXT
): $(TRIMSLASH_OBJ
)
100 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$(TRIMSLASH_OBJ
) $(LIBS
)
102 T_UNSAFE_OBJ
= t_unsafe.o syscall.o util.o t_stub.o lib
/compat.o lib
/snprintf.o
103 t_unsafe
$(EXEEXT
): $(T_UNSAFE_OBJ
)
104 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$(T_UNSAFE_OBJ
) $(LIBS
)
107 cd
$(srcdir) && $(MAKE
) -f prepare-source.mak gen
110 cd
$(srcdir) && $(MAKE
) -f prepare-source.mak man
113 cd
$(srcdir) && $(MAKE
) -f prepare-source.mak proto.h
116 rm -f
*~
$(OBJS
) $(TLS_OBJ
) $(CHECK_PROGS
) $(CHECK_OBJS
) $(CHECK_SYMLINKS
) \
117 mkrounding mkrounding.h rounding.h
122 # We try to delete built files from both the source and build
123 # directories, just in case somebody previously configured things in
124 # the source directory.
126 rm -f Makefile config.h config.status
127 rm -f
$(srcdir)/Makefile
$(srcdir)/config.h
$(srcdir)/config.status
129 rm -f config.cache config.log
130 rm -f
$(srcdir)/config.cache
$(srcdir)/config.log
132 rm -f shconfig
$(srcdir)/shconfig
134 # this target is really just for my use. It only works on a limited
135 # range of machines and is used to produce a list of potentially
136 # dead (ie. unused) functions in the code. (tridge)
138 nm
*.o
*/*.o |grep
'U ' | awk
'{print $$2}' |
sort -u
> nmused.txt
139 nm
*.o
*/*.o |grep
'T ' | awk
'{print $$3}' |
sort -u
> nmfns.txt
140 comm
-13 nmused.txt nmfns.txt
142 # 'check' is the GNU name, 'test' is the name for everybody else :-)
147 # There seems to be no standard way to specify some variables as
148 # exported from a Makefile apart from listing them like this.
150 # This depends on building rsync; if we need any helper programs it
151 # should depend on them too.
153 # We try to run the scripts with POSIX mode on, in the hope that will
154 # catch Bash-isms earlier even if we're running on GNU. Of course, we
155 # might lose in the future where POSIX diverges from old sh.
157 check: all $(CHECK_PROGS
) $(CHECK_SYMLINKS
)
158 rsync_bin
=`pwd`/rsync
$(EXEEXT
) $(srcdir)/runtests.sh
160 check29
: all $(CHECK_PROGS
) $(CHECK_SYMLINKS
)
161 rsync_bin
=`pwd`/rsync
$(EXEEXT
) $(srcdir)/runtests.sh
--protocol
=29
163 wildtest.o
: wildtest.c lib
/wildmatch.c rsync.h
164 wildtest
$(EXEEXT
): wildtest.o lib
/compat.o lib
/snprintf.o @BUILD_POPT@
165 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$@ wildtest.o lib
/compat.o lib
/snprintf.o @BUILD_POPT@
$(LIBS
)
167 testsuite
/chown-fake.
test:
168 ln
-s chown.
test $(srcdir)/testsuite
/chown-fake.
test
170 testsuite
/devices-fake.
test:
171 ln
-s devices.
test $(srcdir)/testsuite
/devices-fake.
test
173 # This does *not* depend on building or installing: you can use it to
174 # check a version installed from a binary or some other source tree,
177 installcheck: $(CHECK_PROGS
) $(CHECK_SYMLINKS
)
178 POSIXLY_CORRECT
=1 TOOLDIR
=`pwd` rsync_bin
="$(bindir)/rsync$(EXEEXT)" srcdir="$(srcdir)" $(srcdir)/runtests.sh
180 # TODO: Add 'dist' target; need to know which files will be included
182 # Run the SPLINT (Secure Programming Lint) tool. <www.splint.org>
185 splint
+unixlib
+gnuextensions
-weak rsync.c
188 rsync.
dvi: doc
/rsync.texinfo
194 rsync.pdf
: doc
/rsync.texinfo
195 texi2dvi -o
$@
--pdf
$<
199 cd
$(srcdir) && rm dox
/html
/* && doxygen
201 # for maintainers only
203 rsync
-avzv
$(srcdir)/dox
/html
/ --delete \
204 samba.org
:/home
/httpd
/html
/rsync
/doxygen
/head
/