Made write_sbuf() non-static.
[rsync.git] / Makefile.in
1 # Makefile for rsync. This is processed by configure to produce the final
2 # Makefile
3
4 prefix=@prefix@
5 exec_prefix=@exec_prefix@
6 bindir=@bindir@
7 mandir=@mandir@
8
9 LIBS=@LIBS@
10 CC=@CC@
11 CFLAGS=@CFLAGS@
12 CPPFLAGS=@CPPFLAGS@
13 EXEEXT=@EXEEXT@
14 LDFLAGS=@LDFLAGS@
15
16 INSTALLCMD=@INSTALL@
17 INSTALLMAN=@INSTALL@
18
19 srcdir=@srcdir@
20 VPATH=$(srcdir)
21 SHELL=/bin/sh
22
23 VERSION=@VERSION@
24
25 .SUFFIXES:
26 .SUFFIXES: .c .o
27
28 HEADERS=byteorder.h config.h errcode.h proto.h rsync.h lib/pool_alloc.h
29 LIBOBJ=lib/wildmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o \
30         lib/permstring.o lib/pool_alloc.o @LIBOBJS@
31 ZLIBOBJ=zlib/deflate.o zlib/infblock.o zlib/infcodes.o zlib/inffast.o \
32         zlib/inflate.o zlib/inftrees.o zlib/infutil.o zlib/trees.o \
33         zlib/zutil.o zlib/adler32.o
34 OBJS1=rsync.o generator.o receiver.o cleanup.o sender.o exclude.o util.o \
35         main.o checksum.o match.o syscall.o log.o backup.o
36 OBJS2=options.o flist.o io.o compat.o hlink.o token.o uidlist.o socket.o \
37         fileio.o batch.o clientname.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@
43
44 TLS_OBJ = tls.o syscall.o lib/permstring.o
45
46 # Programs we must have to run the test cases
47 CHECK_PROGS = rsync$(EXEEXT) tls$(EXEEXT) getgroups$(EXEEXT) \
48         trimslash$(EXEEXT) t_unsafe$(EXEEXT) wildtest$(EXEEXT)
49
50 # Objects for CHECK_PROGS to clean
51 CHECK_OBJS=getgroups.o t_stub.o t_unsafe.o trimslash.o wildtest.o
52
53 # note that the -I. is needed to handle config.h when using VPATH
54 .c.o:
55 @OBJ_SAVE@
56         $(CC) -I. -I$(srcdir) $(CFLAGS) $(CPPFLAGS) -c $< @CC_SHOBJ_FLAG@
57 @OBJ_RESTORE@
58
59 all: rsync$(EXEEXT)
60
61 install: all
62         -mkdir -p ${DESTDIR}${bindir}
63         ${INSTALLCMD} ${INSTALL_STRIP} -m 755 rsync$(EXEEXT) ${DESTDIR}${bindir}
64         -mkdir -p ${DESTDIR}${mandir}/man1
65         -mkdir -p ${DESTDIR}${mandir}/man5
66         ${INSTALLMAN} -m 644 $(srcdir)/rsync.1 ${DESTDIR}${mandir}/man1
67         ${INSTALLMAN} -m 644 $(srcdir)/rsyncd.conf.5 ${DESTDIR}${mandir}/man5
68
69 install-strip:
70         $(MAKE) INSTALL_STRIP='-s' install
71
72 rsync$(EXEEXT): $(OBJS)
73         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
74
75 $(OBJS): $(HEADERS)
76
77 tls$(EXEEXT): $(TLS_OBJ)
78         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TLS_OBJ) $(LIBS)
79
80 getgroups$(EXEEXT): getgroups.o
81         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getgroups.o $(LIBS)
82
83 TRIMSLASH_OBJ = trimslash.o syscall.o
84 trimslash$(EXEEXT): $(TRIMSLASH_OBJ)
85         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TRIMSLASH_OBJ) $(LIBS)
86
87 T_UNSAFE_OBJ = t_unsafe.o syscall.o util.o t_stub.o lib/compat.o lib/snprintf.o
88 t_unsafe$(EXEEXT): $(T_UNSAFE_OBJ)
89         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(T_UNSAFE_OBJ) $(LIBS)
90
91 gen: $(srcdir)/configure $(srcdir)/config.h.in proto man
92
93 man: $(srcdir)/rsync.1 $(srcdir)/rsyncd.conf.5
94
95 $(srcdir)/configure: $(srcdir)/configure.in $(srcdir)/aclocal.m4
96         cd $(srcdir); autoconf
97
98 $(srcdir)/config.h.in: $(srcdir)/configure.in $(srcdir)/aclocal.m4
99         cd $(srcdir); autoheader
100
101 $(srcdir)/rsync.1: $(srcdir)/rsync.yo
102         yodl2man -o $(srcdir)/rsync.1 $(srcdir)/rsync.yo
103
104 $(srcdir)/rsyncd.conf.5: $(srcdir)/rsyncd.conf.yo
105         yodl2man -o $(srcdir)/rsyncd.conf.5 $(srcdir)/rsyncd.conf.yo
106
107 proto:
108         cat $(srcdir)/*.c $(srcdir)/lib/compat.c | awk -f $(srcdir)/mkproto.awk >$(srcdir)/proto.h.new
109         if diff $(srcdir)/proto.h $(srcdir)/proto.h.new >/dev/null; then \
110           rm $(srcdir)/proto.h.new; \
111         else \
112           mv $(srcdir)/proto.h.new $(srcdir)/proto.h; \
113         fi
114
115 clean: cleantests
116         rm -f *~ $(OBJS) $(TLS_OBJ) $(CHECK_PROGS) $(CHECK_OBJS)
117
118 cleantests:
119         rm -rf ./testtmp*
120
121 # We try to delete built files from both the source and build
122 # directories, just in case somebody previously configured things in
123 # the source directory.
124 distclean: clean
125         rm -f Makefile config.h config.status
126         rm -f $(srcdir)/Makefile $(srcdir)/config.h $(srcdir)/config.status
127
128         rm -f config.cache config.log
129         rm -f $(srcdir)/config.cache $(srcdir)/config.log
130
131         rm -f shconfig $(srcdir)/shconfig
132
133 # this target is really just for my use. It only works on a limited
134 # range of machines and is used to produce a list of potentially
135 # dead (ie. unused) functions in the code. (tridge)
136 finddead:
137         nm *.o */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt
138         nm *.o */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt
139         comm -13 nmused.txt nmfns.txt
140
141 # 'check' is the GNU name, 'test' is the name for everybody else :-)
142 .PHONY: check test
143
144 test: check
145
146
147 # There seems to be no standard way to specify some variables as
148 # exported from a Makefile apart from listing them like this.
149
150 # This depends on building rsync; if we need any helper programs it
151 # should depend on them too.
152
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.
156
157 check: all $(CHECK_PROGS)
158         POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin=`pwd`/rsync$(EXEEXT) srcdir="$(srcdir)" $(srcdir)/runtests.sh
159
160 wildtest.o: wildtest.c lib/wildmatch.c rsync.h
161 wildtest$(EXEEXT): wildtest.o
162         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ wildtest.o @BUILD_POPT@ $(LIBS)
163
164 # This does *not* depend on building or installing: you can use it to
165 # check a version installed from a binary or some other source tree,
166 # if you want.
167
168 installcheck: $(CHECK_PROGS)
169         POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin="$(bindir)/rsync$(EXEEXT)" srcdir="$(srcdir)" $(srcdir)/runtests.sh
170
171 # TODO: Add 'dist' target; need to know which files will be included
172
173 # Run the SPLINT (Secure Programming Lint) tool.  <www.splint.org>
174 .PHONY: splint
175 splint:
176         splint +unixlib +gnuextensions -weak rsync.c
177
178
179 rsync.dvi: doc/rsync.texinfo
180         texi2dvi -o $@ $<
181
182 rsync.ps: rsync.dvi
183         dvips -ta4 -o $@ $<
184
185 rsync.pdf: doc/rsync.texinfo
186         texi2dvi -o $@ --pdf $<
187
188
189 doxygen:
190         cd $(srcdir) && rm dox/html/* && doxygen
191
192 # for maintainers only
193 doxygen-upload:
194         rsync -avzv $(srcdir)/dox/html/ --delete \
195         samba.org:/home/httpd/html/rsync/doxygen/head/