1 # Makefile for rsync. This is processed by configure to produce the final
5 exec_prefix=@exec_prefix@
26 LIBOBJ=lib/fnmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o \
29 ZLIBOBJ=zlib/deflate.o zlib/infblock.o zlib/infcodes.o zlib/inffast.o \
30 zlib/inflate.o zlib/inftrees.o zlib/infutil.o zlib/trees.o \
31 zlib/zutil.o zlib/adler32.o
32 OBJS1=rsync.o generator.o receiver.o cleanup.o sender.o exclude.o util.o main.o checksum.o match.o syscall.o log.o backup.o
33 OBJS2=options.o flist.o io.o compat.o hlink.o token.o uidlist.o socket.o fileio.o batch.o \
35 OBJS3=progress.o pipe.o
36 DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
37 popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
38 popt/popthelp.o popt/poptparse.o
39 OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) $(ZLIBOBJ) @BUILD_POPT@
41 TLS_OBJ = tls.o syscall.o lib/permstring.o
43 # Programs we must have to run the test cases
44 CHECK_PROGS = rsync tls getgroups trimslash t_unsafe
46 # Objects for CHECK_PROGS to clean
47 CHECK_OBJS=getgroups.o t_stub.o t_unsafe.o trimslash.o
49 # note that the -I. is needed to handle config.h when using VPATH
52 $(CC) -I. -I$(srcdir) $(CFLAGS) -c $< @CC_SHOBJ_FLAG@
57 man: rsync.1 rsyncd.conf.5
60 -mkdir -p ${DESTDIR}${bindir}
61 ${INSTALLCMD} ${STRIP} -m 755 rsync ${DESTDIR}${bindir}
62 -mkdir -p ${DESTDIR}${mandir}/man1
63 -mkdir -p ${DESTDIR}${mandir}/man5
64 ${INSTALLMAN} -m 644 $(srcdir)/rsync.1 ${DESTDIR}${mandir}/man1
65 ${INSTALLMAN} -m 644 $(srcdir)/rsyncd.conf.5 ${DESTDIR}${mandir}/man5
68 $(MAKE) STRIP='-s' install
71 @echo "Please ignore warnings below about mktemp -- it is used in a safe way"
72 $(CC) $(CFLAGS) $(LDFLAGS) -o rsync $(OBJS) $(LIBS)
77 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TLS_OBJ) $(LIBS)
79 getgroups: getgroups.o
80 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getgroups.o $(LIBS)
82 TRIMSLASH_OBJ = trimslash.o syscall.o
83 trimslash: $(TRIMSLASH_OBJ)
84 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TRIMSLASH_OBJ) $(LIBS)
86 T_UNSAFE_OBJ = t_unsafe.o syscall.o util.o t_stub.o lib/compat.o lib/snprintf.o
87 t_unsafe: $(T_UNSAFE_OBJ)
88 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(T_UNSAFE_OBJ) $(LIBS)
90 # I don't like these rules because CVS can skew the timestamps and
91 # produce spurious warnings, and also make "make install" fail if the
92 # source directory can no longer be found. Since we don't rebuild
93 # automatically they're kind of lame anyhow.
95 #Makefile: Makefile.in configure config.status
96 # echo "WARNING: You need to run ./config.status --recheck"
98 # don't actually run autoconf, just issue a warning
99 #configure: configure.in
100 # echo "WARNING: you need to rerun autoconf"
102 $(srcdir)/rsync.1: $(srcdir)/rsync.yo
103 yodl2man -o $(srcdir)/rsync.1 $(srcdir)/rsync.yo
105 $(srcdir)/rsyncd.conf.5: $(srcdir)/rsyncd.conf.yo
106 yodl2man -o $(srcdir)/rsyncd.conf.5 $(srcdir)/rsyncd.conf.yo
109 cat $(srcdir)/*.c $(srcdir)/lib/compat.c | awk -f $(srcdir)/mkproto.awk > $(srcdir)/proto.h
112 rm -f *~ $(OBJS) rsync $(TLS_OBJ) $(CHECK_PROGS) $(CHECK_OBJS)
117 # We try to delete built files from both the source and build
118 # directories, just in case somebody previously configured things in
119 # the source directory.
121 rm -f Makefile config.h config.status
122 rm -f $(srcdir)/Makefile $(srcdir)/config.h $(srcdir)/config.status
124 rm -f config.cache config.log
125 rm -f $(srcdir)/config.cache $(srcdir)/config.log
127 rm -f shconfig $(srcdir)/shconfig
129 # this target is really just for my use. It only works on a limited
130 # range of machines and is used to produce a list of potentially
131 # dead (ie. unused) functions in the code. (tridge)
133 nm *.o */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt
134 nm *.o */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt
135 comm -13 nmused.txt nmfns.txt
137 # 'check' is the GNU name, 'test' is the name for everybody else :-)
143 # There seems to be no standard way to specify some variables as
144 # exported from a Makefile apart from listing them like this.
146 # TODO: Tests that depend on built test aide programs like tls need to
147 # know where the build directory is.
149 # This depends on building rsync; if we need any helper programs it
150 # should depend on them too.
152 # We try to run the scripts with POSIX mode on, in the hope that will
153 # catch Bash-isms earlier even if we're running on GNU. Of course, we
154 # might lose in the future where POSIX diverges from old sh.
156 check: all $(CHECK_PROGS)
157 POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin=`pwd`/rsync srcdir="$(srcdir)" $(srcdir)/runtests.sh
159 # This does *not* depend on building or installing: you can use it to
160 # check a version installed from a binary or some other source tree,
163 installcheck: $(CHECK_PROGS)
164 POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin="$(bindir)/rsync" srcdir="$(srcdir)" $(srcdir)/runtests.sh
166 # TODO: Add 'dist' target; need to know which files will be included
168 # Run the SPLINT (Secure Programming Lint) tool. <www.splint.org>
171 splint +unixlib +gnuextensions -weak rsync.c
174 rsync.dvi: doc/rsync.texinfo
180 rsync.pdf: doc/rsync.texinfo
181 texi2dvi -o $@ --pdf $<
185 cd $(srcdir) && rm dox/html/* && doxygen
187 # for maintainers only
189 rsync -avzv $(srcdir)/dox/html/ --delete \
190 samba.org:/home/httpd/html/rsync/doxygen/head/