In mplex_write(), make extra sure something unexpected doesn't get
[rsync.git] / Makefile.in
blob499de47b015d90ed4a226f75e582bb3e53a250bc
1 # Makefile for rsync. This is processed by configure to produce the final
2 # Makefile
4 prefix=@prefix@
5 datarootdir=@datarootdir@
6 exec_prefix=@exec_prefix@
7 bindir=@bindir@
8 mandir=@mandir@
10 LIBS=@LIBS@
11 CC=@CC@
12 CFLAGS=@CFLAGS@
13 CPPFLAGS=@CPPFLAGS@
14 EXEEXT=@EXEEXT@
15 LDFLAGS=@LDFLAGS@
17 INSTALLCMD=@INSTALL@
18 INSTALLMAN=@INSTALL@
20 srcdir=@srcdir@
21 VPATH=$(srcdir)
22 SHELL=/bin/sh
24 VERSION=@VERSION@
26 .SUFFIXES:
27 .SUFFIXES: .c .o
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
56 .c.o:
57 @OBJ_SAVE@
58 $(CC) -I. -I$(srcdir) $(CFLAGS) $(CPPFLAGS) -c $< @CC_SHOBJ_FLAG@
59 @OBJ_RESTORE@
61 all: rsync$(EXEEXT)
63 install: all
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
71 install-strip:
72 $(MAKE) INSTALL_STRIP='-s' install
74 rsync$(EXEEXT): $(OBJS)
75 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
77 $(OBJS): $(HEADERS)
79 flist.o: rounding.h
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
87 @rm mkrounding.h
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)
106 gen:
107 cd $(srcdir) && $(MAKE) -f prepare-source.mak gen
109 man:
110 cd $(srcdir) && $(MAKE) -f prepare-source.mak man
112 proto:
113 cd $(srcdir) && $(MAKE) -f prepare-source.mak proto.h
115 clean: cleantests
116 rm -f *~ $(OBJS) $(TLS_OBJ) $(CHECK_PROGS) $(CHECK_OBJS) $(CHECK_SYMLINKS) \
117 mkrounding mkrounding.h rounding.h
119 cleantests:
120 rm -rf ./testtmp*
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.
125 distclean: clean
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)
137 finddead:
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 :-)
143 .PHONY: check test
145 test: check
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,
175 # if you want.
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>
183 .PHONY: splint
184 splint:
185 splint +unixlib +gnuextensions -weak rsync.c
188 rsync.dvi: doc/rsync.texinfo
189 texi2dvi -o $@ $<
191 rsync.ps: rsync.dvi
192 dvips -ta4 -o $@ $<
194 rsync.pdf: doc/rsync.texinfo
195 texi2dvi -o $@ --pdf $<
198 doxygen:
199 cd $(srcdir) && rm dox/html/* && doxygen
201 # for maintainers only
202 doxygen-upload:
203 rsync -avzv $(srcdir)/dox/html/ --delete \
204 samba.org:/home/httpd/html/rsync/doxygen/head/