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