1: # Makefile for rsync. This is processed by configure to produce the final
2: # Makefile
3:
4: prefix=@prefix@
5: datarootdir=@datarootdir@
6: exec_prefix=@exec_prefix@
7: bindir=@bindir@
8: mandir=@mandir@
9:
10: LIBS=@LIBS@
11: CC=@CC@
12: CFLAGS=@CFLAGS@
13: CPPFLAGS=@CPPFLAGS@
14: EXEEXT=@EXEEXT@
15: LDFLAGS=@LDFLAGS@
16:
17: INSTALLCMD=@INSTALL@
18: INSTALLMAN=@INSTALL@
19:
20: srcdir=@srcdir@
21: VPATH=$(srcdir)
22: SHELL=/bin/sh
23:
24: VERSION=@VERSION@
25:
26: .SUFFIXES:
27: .SUFFIXES: .c .o
28:
29: GENFILES=configure.sh config.h.in proto.h proto.h-tstamp rsync.1 rsyncd.conf.5
30: HEADERS=byteorder.h config.h errcode.h proto.h rsync.h ifuncs.h lib/pool_alloc.h
31: LIBOBJ=lib/wildmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o lib/md5.o \
32: lib/permstring.o lib/pool_alloc.o lib/sysacls.o lib/sysxattrs.o @LIBOBJS@
33: ZLIBOBJ=zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o \
34: zlib/trees.o zlib/zutil.o zlib/adler32.o zlib/compress.o zlib/crc32.o
35: OBJS1=flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o \
36: util.o main.o checksum.o match.o syscall.o log.o backup.o
37: OBJS2=options.o io.o compat.o hlink.o token.o uidlist.o socket.o hashtable.o \
38: fileio.o batch.o clientname.o chmod.o acls.o xattrs.o
39: OBJS3=progress.o pipe.o
40: DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
41: popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
42: popt/popthelp.o popt/poptparse.o
43: OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) $(ZLIBOBJ) @BUILD_POPT@
44:
45: TLS_OBJ = tls.o syscall.o lib/compat.o lib/snprintf.o lib/permstring.o lib/sysxattrs.o @BUILD_POPT@
46:
47: # Programs we must have to run the test cases
48: CHECK_PROGS = rsync$(EXEEXT) tls$(EXEEXT) getgroups$(EXEEXT) getfsdev$(EXEEXT) \
49: trimslash$(EXEEXT) t_unsafe$(EXEEXT) wildtest$(EXEEXT)
50:
51: CHECK_SYMLINKS = testsuite/chown-fake.test testsuite/devices-fake.test testsuite/xattrs-hlink.test
52:
53: # Objects for CHECK_PROGS to clean
54: CHECK_OBJS=tls.o getgroups.o getfsdev.o t_stub.o t_unsafe.o trimslash.o wildtest.o
55:
56: # note that the -I. is needed to handle config.h when using VPATH
57: .c.o:
58: @OBJ_SAVE@
59: $(CC) -I. -I$(srcdir) $(CFLAGS) $(CPPFLAGS) -c $< @CC_SHOBJ_FLAG@
60: @OBJ_RESTORE@
61:
62: all: Makefile rsync$(EXEEXT) @MAKE_MAN@
63:
64: install: all
65: -mkdir -p ${DESTDIR}${bindir}
66: ${INSTALLCMD} ${INSTALL_STRIP} -m 755 rsync$(EXEEXT) ${DESTDIR}${bindir}
67: -mkdir -p ${DESTDIR}${mandir}/man1
68: -mkdir -p ${DESTDIR}${mandir}/man5
69: if test -f rsync.1; then ${INSTALLMAN} -m 644 rsync.1 ${DESTDIR}${mandir}/man1; fi
70: if test -f rsyncd.conf.5; then ${INSTALLMAN} -m 644 rsyncd.conf.5 ${DESTDIR}${mandir}/man5; fi
71:
72: install-strip:
73: $(MAKE) INSTALL_STRIP='-s' install
74:
75: rsync$(EXEEXT): $(OBJS)
76: $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
77:
78: $(OBJS): $(HEADERS)
79: $(CHECK_OBJS): $(HEADERS)
80:
81: flist.o: rounding.h
82:
83: rounding.h: rounding.c rsync.h
84: @for r in 0 1 3; do \
85: if $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o rounding -DEXTRA_ROUNDING=$$r -I. $(srcdir)/rounding.c >rounding.out 2>&1; then \
86: echo "#define EXTRA_ROUNDING $$r" >rounding.h; \
87: if test -f "$$HOME/build_farm/build_test.fns"; then \
88: echo "EXTRA_ROUNDING is $$r" >&2; \
89: fi; \
90: break; \
91: fi; \
92: done
93: @rm -f rounding
94: @if test -f rounding.h; then : ; else \
95: cat rounding.out 1>&2; \
96: echo "Failed to create rounding.h!" 1>&2; \
97: exit 1; \
98: fi
99: @rm -f rounding.out
100:
101: tls$(EXEEXT): $(TLS_OBJ)
102: $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TLS_OBJ) $(LIBS)
103:
104: getgroups$(EXEEXT): getgroups.o
105: $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getgroups.o $(LIBS)
106:
107: getfsdev$(EXEEXT): getfsdev.o
108: $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getfsdev.o $(LIBS)
109:
110: TRIMSLASH_OBJ = trimslash.o syscall.o lib/compat.o lib/snprintf.o
111: trimslash$(EXEEXT): $(TRIMSLASH_OBJ)
112: $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TRIMSLASH_OBJ) $(LIBS)
113:
114: T_UNSAFE_OBJ = t_unsafe.o syscall.o util.o t_stub.o lib/compat.o lib/snprintf.o lib/wildmatch.o
115: t_unsafe$(EXEEXT): $(T_UNSAFE_OBJ)
116: $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(T_UNSAFE_OBJ) $(LIBS)
117:
118: gen: conf proto.h man
119:
120: gensend: gen
121: rsync -aivzc $(GENFILES) samba.org:/home/ftp/pub/rsync/generated-files/
122:
123: conf:
124: cd $(srcdir) && $(MAKE) -f prepare-source.mak conf
125:
126: configure.sh config.h.in: configure.ac aclocal.m4
127: @if test -f configure.sh; then cp -p configure.sh configure.sh.old; else touch configure.sh.old; fi
128: @if test -f config.h.in; then cp -p config.h.in config.h.in.old; else touch config.h.in.old; fi
129: autoconf -o configure.sh
130: autoheader && touch config.h.in
131: @if diff configure.sh configure.sh.old >/dev/null 2>&1; then \
132: echo "configure.sh is unchanged."; \
133: rm configure.sh.old; \
134: else \
135: echo "configure.sh has CHANGED."; \
136: fi
137: @if diff config.h.in config.h.in.old >/dev/null 2>&1; then \
138: echo "config.h.in is unchanged."; \
139: rm config.h.in.old; \
140: else \
141: echo "config.h.in has CHANGED."; \
142: fi
143: @if test -f configure.sh.old -o -f config.h.in.old; then \
144: if test "$(MAKECMDGOALS)" = reconfigure; then \
145: echo 'Continuing with "make reconfigure".'; \
146: else \
147: echo 'You may need to run:'; \
148: echo ' make reconfigure'; \
149: exit 1; \
150: fi \
151: fi
152:
153: reconfigure: configure.sh
154: ./config.status --recheck
155: ./config.status
156:
157: Makefile: Makefile.in config.status configure.sh config.h.in
158: @if test -f Makefile; then cp -p Makefile Makefile.old; else touch Makefile.old; fi
159: @./config.status
160: @if diff Makefile Makefile.old >/dev/null 2>&1; then \
161: echo "Makefile is unchanged."; \
162: rm Makefile.old; \
163: else \
164: if test "$(MAKECMDGOALS)" = reconfigure; then \
165: echo 'Continuing with "make reconfigure".'; \
166: else \
167: echo "Makefile updated -- rerun your make command."; \
168: exit 1; \
169: fi \
170: fi
171:
172: proto: proto.h-tstamp
173:
174: proto.h: proto.h-tstamp
175: @if test -f proto.h; then :; else cp -p $(srcdir)/proto.h .; fi
176:
177: proto.h-tstamp: $(srcdir)/*.c $(srcdir)/lib/compat.c config.h
178: perl $(srcdir)/mkproto.pl $(srcdir)/*.c $(srcdir)/lib/compat.c
179:
180: man: rsync.1 rsyncd.conf.5
181: @if test -f rsync.1; then :; else cp -p $(srcdir)/rsync.1 .; fi
182: @if test -f rsyncd.conf.5; then :; else cp -p $(srcdir)/rsyncd.conf.5 .; fi
183:
184: rsync.1: rsync.yo
185: yodl2man -o rsync.1 $(srcdir)/rsync.yo
186: -$(srcdir)/tweak_manpage rsync.1
187:
188: rsyncd.conf.5: rsyncd.conf.yo
189: yodl2man -o rsyncd.conf.5 $(srcdir)/rsyncd.conf.yo
190: -$(srcdir)/tweak_manpage rsyncd.conf.5
191:
192: clean: cleantests
193: rm -f *~ $(OBJS) $(CHECK_PROGS) $(CHECK_OBJS) $(CHECK_SYMLINKS) \
194: rounding rounding.h *.old
195:
196: cleantests:
197: rm -rf ./testtmp*
198:
199: # We try to delete built files from both the source and build
200: # directories, just in case somebody previously configured things in
201: # the source directory.
202: distclean: clean
203: rm -f Makefile config.h config.status
204: rm -f lib/dummy popt/dummy zlib/dummy
205: rm -f $(srcdir)/Makefile $(srcdir)/config.h $(srcdir)/config.status
206: rm -f $(srcdir)/lib/dummy $(srcdir)/popt/dummy $(srcdir)/zlib/dummy
207: rm -f config.cache config.log
208: rm -f $(srcdir)/config.cache $(srcdir)/config.log
209: rm -f shconfig $(srcdir)/shconfig
210: rm -f $(GENFILES)
211: rm -rf autom4te.cache
212:
213: # this target is really just for my use. It only works on a limited
214: # range of machines and is used to produce a list of potentially
215: # dead (ie. unused) functions in the code. (tridge)
216: finddead:
217: nm *.o */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt
218: nm *.o */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt
219: comm -13 nmused.txt nmfns.txt
220:
221: # 'check' is the GNU name, 'test' is the name for everybody else :-)
222: .PHONY: check test
223:
224: test: check
225:
226: # There seems to be no standard way to specify some variables as
227: # exported from a Makefile apart from listing them like this.
228:
229: # This depends on building rsync; if we need any helper programs it
230: # should depend on them too.
231:
232: # We try to run the scripts with POSIX mode on, in the hope that will
233: # catch Bash-isms earlier even if we're running on GNU. Of course, we
234: # might lose in the future where POSIX diverges from old sh.
235:
236: check: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
237: rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh
238:
239: check29: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
240: rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh --protocol=29
241:
242: wildtest.o: wildtest.c lib/wildmatch.c rsync.h config.h
243: wildtest$(EXEEXT): wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@
244: $(CC) $(CFLAGS) $(LDFLAGS) -o $@ wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@ $(LIBS)
245:
246: testsuite/chown-fake.test:
247: ln -s chown.test $(srcdir)/testsuite/chown-fake.test
248:
249: testsuite/devices-fake.test:
250: ln -s devices.test $(srcdir)/testsuite/devices-fake.test
251:
252: testsuite/xattrs-hlink.test:
253: ln -s xattrs.test $(srcdir)/testsuite/xattrs-hlink.test
254:
255: # This does *not* depend on building or installing: you can use it to
256: # check a version installed from a binary or some other source tree,
257: # if you want.
258:
259: installcheck: $(CHECK_PROGS) $(CHECK_SYMLINKS)
260: POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin="$(bindir)/rsync$(EXEEXT)" srcdir="$(srcdir)" $(srcdir)/runtests.sh
261:
262: # TODO: Add 'dist' target; need to know which files will be included
263:
264: # Run the SPLINT (Secure Programming Lint) tool. <www.splint.org>
265: .PHONY: splint
266: splint:
267: splint +unixlib +gnuextensions -weak rsync.c
268:
269:
270: rsync.dvi: doc/rsync.texinfo
271: texi2dvi -o $@ $<
272:
273: rsync.ps: rsync.dvi
274: dvips -ta4 -o $@ $<
275:
276: rsync.pdf: doc/rsync.texinfo
277: texi2dvi -o $@ --pdf $<
278:
279:
280: doxygen:
281: cd $(srcdir) && rm dox/html/* && doxygen
282:
283: # for maintainers only
284: doxygen-upload:
285: rsync -avzv $(srcdir)/dox/html/ --delete \
286: samba.org:/home/httpd/html/rsync/doxygen/head/
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>