Makefile.in 9.1 KB

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