Use a non-printing command for proto.h's build-rule.
[rsync.git] / Makefile.in
blob8d814eed03aa8cc0f13d09e918f81e62ae9eba5b
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 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@
45 TLS_OBJ = tls.o syscall.o lib/compat.o lib/snprintf.o lib/permstring.o lib/sysxattrs.o @BUILD_POPT@
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)
51 CHECK_SYMLINKS = testsuite/chown-fake.test testsuite/devices-fake.test
53 # Objects for CHECK_PROGS to clean
54 CHECK_OBJS=getgroups.o getfsdev.o t_stub.o t_unsafe.o trimslash.o wildtest.o
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@
62 all: conf_stop rsync$(EXEEXT) @MAKE_MAN@
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 $(srcdir)/rsync.1; then ${INSTALLMAN} -m 644 $(srcdir)/rsync.1 ${DESTDIR}${mandir}/man1; fi
70 if test -f $(srcdir)/rsyncd.conf.5; then ${INSTALLMAN} -m 644 $(srcdir)/rsyncd.conf.5 ${DESTDIR}${mandir}/man5; fi
72 install-strip:
73 $(MAKE) INSTALL_STRIP='-s' install
75 rsync$(EXEEXT): $(OBJS)
76 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
78 $(OBJS): $(HEADERS)
80 flist.o: rounding.h
82 rounding.h: mkrounding$(EXEEXT)
83 ./mkrounding$(EXEEXT) >rounding.h
85 mkrounding$(EXEEXT): mkrounding.c rsync.h
86 @sed '1,/^struct file_struct/d; /^}/,$$d' <$(srcdir)/rsync.h >mkrounding.h
87 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ -I. $(srcdir)/mkrounding.c
88 @rm mkrounding.h
90 tls$(EXEEXT): $(TLS_OBJ)
91 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TLS_OBJ) $(LIBS)
93 getgroups$(EXEEXT): getgroups.o
94 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getgroups.o $(LIBS)
96 getfsdev$(EXEEXT): getfsdev.o
97 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getfsdev.o $(LIBS)
99 TRIMSLASH_OBJ = trimslash.o syscall.o lib/compat.o lib/snprintf.o
100 trimslash$(EXEEXT): $(TRIMSLASH_OBJ)
101 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TRIMSLASH_OBJ) $(LIBS)
103 T_UNSAFE_OBJ = t_unsafe.o syscall.o util.o t_stub.o lib/compat.o lib/snprintf.o
104 t_unsafe$(EXEEXT): $(T_UNSAFE_OBJ)
105 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(T_UNSAFE_OBJ) $(LIBS)
107 gen: conf proto.h man
109 gensend: gen
110 rsync -aivzc $(GENFILES) samba.org:/home/ftp/pub/rsync/generated-files/
112 conf:
113 cd $(srcdir) && $(MAKE) -f prepare-source.mak conf
115 conf_stop: configure.sh config.h.in
117 configure.sh config.h.in: configure.in aclocal.m4
118 autoconf -o configure.sh
119 autoheader && touch config.h.in
120 @echo 'Configure files changed -- perhaps run:'
121 @echo ' ./config.status --recheck; ./config.status'
122 @exit 1
124 proto: proto.h-tstamp
126 proto.h: proto.h-tstamp
127 @echo ' ' >/dev/null
129 proto.h-tstamp: *.c lib/compat.c
130 perl mkproto.pl *.c lib/compat.c
132 man: rsync.1 rsyncd.conf.5
134 rsync.1: rsync.yo
135 yodl2man -o rsync.1 rsync.yo
136 -./tweak_manpage rsync.1
138 rsyncd.conf.5: rsyncd.conf.yo
139 yodl2man -o rsyncd.conf.5 rsyncd.conf.yo
140 -./tweak_manpage rsyncd.conf.5
142 clean: cleantests
143 rm -f *~ $(OBJS) $(TLS_OBJ) $(CHECK_PROGS) $(CHECK_OBJS) $(CHECK_SYMLINKS) \
144 mkrounding mkrounding.h rounding.h
146 cleantests:
147 rm -rf ./testtmp*
149 # We try to delete built files from both the source and build
150 # directories, just in case somebody previously configured things in
151 # the source directory.
152 distclean: clean
153 rm -f Makefile config.h config.status
154 rm -f $(srcdir)/Makefile $(srcdir)/config.h $(srcdir)/config.status
155 rm -f config.cache config.log
156 rm -f $(srcdir)/config.cache $(srcdir)/config.log
157 rm -f shconfig $(srcdir)/shconfig
158 rm -f $(GENFILES)
160 # this target is really just for my use. It only works on a limited
161 # range of machines and is used to produce a list of potentially
162 # dead (ie. unused) functions in the code. (tridge)
163 finddead:
164 nm *.o */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt
165 nm *.o */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt
166 comm -13 nmused.txt nmfns.txt
168 # 'check' is the GNU name, 'test' is the name for everybody else :-)
169 .PHONY: check test
171 test: check
173 # There seems to be no standard way to specify some variables as
174 # exported from a Makefile apart from listing them like this.
176 # This depends on building rsync; if we need any helper programs it
177 # should depend on them too.
179 # We try to run the scripts with POSIX mode on, in the hope that will
180 # catch Bash-isms earlier even if we're running on GNU. Of course, we
181 # might lose in the future where POSIX diverges from old sh.
183 check: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
184 rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh
186 check29: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
187 rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh --protocol=29
189 wildtest.o: wildtest.c lib/wildmatch.c rsync.h
190 wildtest$(EXEEXT): wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@
191 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@ $(LIBS)
193 testsuite/chown-fake.test:
194 ln -s chown.test $(srcdir)/testsuite/chown-fake.test
196 testsuite/devices-fake.test:
197 ln -s devices.test $(srcdir)/testsuite/devices-fake.test
199 # This does *not* depend on building or installing: you can use it to
200 # check a version installed from a binary or some other source tree,
201 # if you want.
203 installcheck: $(CHECK_PROGS) $(CHECK_SYMLINKS)
204 POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin="$(bindir)/rsync$(EXEEXT)" srcdir="$(srcdir)" $(srcdir)/runtests.sh
206 # TODO: Add 'dist' target; need to know which files will be included
208 # Run the SPLINT (Secure Programming Lint) tool. <www.splint.org>
209 .PHONY: splint
210 splint:
211 splint +unixlib +gnuextensions -weak rsync.c
214 rsync.dvi: doc/rsync.texinfo
215 texi2dvi -o $@ $<
217 rsync.ps: rsync.dvi
218 dvips -ta4 -o $@ $<
220 rsync.pdf: doc/rsync.texinfo
221 texi2dvi -o $@ --pdf $<
224 doxygen:
225 cd $(srcdir) && rm dox/html/* && doxygen
227 # for maintainers only
228 doxygen-upload:
229 rsync -avzv $(srcdir)/dox/html/ --delete \
230 samba.org:/home/httpd/html/rsync/doxygen/head/