1 # Makefile for rsync. This is processed by configure to produce the final
5 exec_prefix=@exec_prefix@
25 LIBOBJ=lib/fnmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o \
28 ZLIBOBJ=zlib/deflate.o zlib/infblock.o zlib/infcodes.o zlib/inffast.o \
29 zlib/inflate.o zlib/inftrees.o zlib/infutil.o zlib/trees.o \
30 zlib/zutil.o zlib/adler32.o
31 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
32 OBJS2=options.o flist.o io.o compat.o hlink.o token.o uidlist.o socket.o fileio.o batch.o \
34 DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
35 popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
36 popt/popthelp.o popt/poptparse.o
37 OBJS=$(OBJS1) $(OBJS2) $(DAEMON_OBJ) $(LIBOBJ) $(ZLIBOBJ) @BUILD_POPT@
39 TLS_OBJ = tls.o syscall.o lib/permstring.o
41 # Programs we must have to run the test cases
42 CHECK_PROGS = rsync tls
44 # note that the -I. is needed to handle config.h when using VPATH
47 $(CC) -I. -I$(srcdir) $(CFLAGS) -c $< @CC_SHOBJ_FLAG@
52 man: rsync.1 rsyncd.conf.5
56 ${INSTALLCMD} -m 755 rsync ${bindir}
57 -mkdir -p ${mandir}/man1
58 -mkdir -p ${mandir}/man5
59 ${INSTALLCMD} -m 644 $(srcdir)/rsync.1 ${mandir}/man1
60 ${INSTALLCMD} -m 644 $(srcdir)/rsyncd.conf.5 ${mandir}/man5
63 $(MAKE) INSTALLCMD='$(INSTALLCMD) -s' install
66 @echo "Please ignore warnings below about mktemp -- it is used in a safe way"
67 $(CC) $(CFLAGS) $(LDFLAGS) -o rsync $(OBJS) $(LIBS)
72 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TLS_OBJ) $(LIBS)
74 Makefile: Makefile.in configure config.status
75 echo "WARNING: You need to run ./config.status --recheck"
77 # don't actually run autoconf, just issue a warning
78 configure: configure.in
79 echo "WARNING: you need to rerun autoconf"
82 yodl2man -o rsync.1 rsync.yo
84 rsyncd.conf.5: rsyncd.conf.yo
85 yodl2man -o rsyncd.conf.5 rsyncd.conf.yo
88 cat $(srcdir)/*.c $(srcdir)/lib/compat.c | awk -f $(srcdir)/mkproto.awk > $(srcdir)/proto.h
91 rm -f *~ $(OBJS) rsync $(TLS_OBJ) tls
96 rm -f Makefile config.h config.status
98 # this target is really just for my use. It only works on a limited
99 # range of machines and is used to produce a list of potentially
100 # dead (ie. unused) functions in the code. (tridge)
102 nm *.o */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt
103 nm *.o */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt
104 comm -13 nmused.txt nmfns.txt
106 # 'check' is the GNU name, 'test' is the name for everybody else :-)
112 # There seems to be no standard way to specify some variables as
113 # exported from a Makefile apart from listing them like this.
115 # TODO: Tests that depend on built test aide programs like tls need to
116 # know where the build directory is.
118 # This depends on building rsync; if we need any helper programs it
119 # should depend on them too.
121 # We try to run the scripts with POSIX mode on, in the hope that will
122 # catch Bash-isms earlier even if we're running on GNU. Of course, we
123 # might lose in the future where POSIX diverges from old sh.
125 check: all $(CHECK_PROGS)
126 POSIXLY_CORRECT=1 TLS=`pwd`/tls rsync_bin=`pwd`/rsync srcdir="$(srcdir)" $(srcdir)/runtests.sh
128 # This does *not* depend on building or installing: you can use it to
129 # check a version installed from a binary or some other source tree,
132 installcheck: $(CHECK_PROGS)
133 POSIXLY_CORRECT=1 TLS=`pwd`/tls rsync_bin="$(bindir)/rsync" srcdir="$(srcdir)" $(srcdir)/runtests.sh
135 # TODO: Add 'dist' target; need to know which files will be included
137 rsync.dvi: doc/rsync.texinfo
143 rsync.pdf: doc/rsync.texinfo
144 texi2dvi -o $@ --pdf $<