Made the (re-)building of the proto.h file automatic in the
[rsync/rsync.git] / Makefile.in
... / ...
CommitLineData
1# Makefile for rsync. This is processed by configure to produce the final
2# Makefile
3
4prefix=@prefix@
5datarootdir=@datarootdir@
6exec_prefix=@exec_prefix@
7bindir=@bindir@
8mandir=@mandir@
9
10LIBS=@LIBS@
11CC=@CC@
12CFLAGS=@CFLAGS@
13CPPFLAGS=@CPPFLAGS@
14EXEEXT=@EXEEXT@
15LDFLAGS=@LDFLAGS@
16
17INSTALLCMD=@INSTALL@
18INSTALLMAN=@INSTALL@
19
20srcdir=@srcdir@
21VPATH=$(srcdir)
22SHELL=/bin/sh
23
24VERSION=@VERSION@
25
26.SUFFIXES:
27.SUFFIXES: .c .o
28
29GENFILES=configure.sh config.h.in proto.h rsync.1 rsyncd.conf.5
30HEADERS=byteorder.h config.h errcode.h proto.h rsync.h ifuncs.h lib/pool_alloc.h
31LIBOBJ=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@
33ZLIBOBJ=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
35OBJS1=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
37OBJS2=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
39OBJS3=progress.o pipe.o
40DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
41popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
42 popt/popthelp.o popt/poptparse.o
43OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) $(ZLIBOBJ) @BUILD_POPT@
44
45TLS_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
48CHECK_PROGS = rsync$(EXEEXT) tls$(EXEEXT) getgroups$(EXEEXT) getfsdev$(EXEEXT) \
49 trimslash$(EXEEXT) t_unsafe$(EXEEXT) wildtest$(EXEEXT)
50
51CHECK_SYMLINKS = testsuite/chown-fake.test testsuite/devices-fake.test
52
53# Objects for CHECK_PROGS to clean
54CHECK_OBJS=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
62all: rsync$(EXEEXT) @MAKE_MAN@
63
64install: 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
71
72install-strip:
73 $(MAKE) INSTALL_STRIP='-s' install
74
75rsync$(EXEEXT): $(OBJS)
76 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
77
78$(OBJS): $(HEADERS)
79
80flist.o: rounding.h
81
82rounding.h: mkrounding$(EXEEXT)
83 ./mkrounding$(EXEEXT) >rounding.h
84
85mkrounding$(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
89
90tls$(EXEEXT): $(TLS_OBJ)
91 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TLS_OBJ) $(LIBS)
92
93getgroups$(EXEEXT): getgroups.o
94 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getgroups.o $(LIBS)
95
96getfsdev$(EXEEXT): getfsdev.o
97 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getfsdev.o $(LIBS)
98
99TRIMSLASH_OBJ = trimslash.o syscall.o lib/compat.o lib/snprintf.o
100trimslash$(EXEEXT): $(TRIMSLASH_OBJ)
101 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TRIMSLASH_OBJ) $(LIBS)
102
103T_UNSAFE_OBJ = t_unsafe.o syscall.o util.o t_stub.o lib/compat.o lib/snprintf.o
104t_unsafe$(EXEEXT): $(T_UNSAFE_OBJ)
105 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(T_UNSAFE_OBJ) $(LIBS)
106
107gen: conf proto.h man
108
109conf:
110 cd $(srcdir) && $(MAKE) -f prepare-source.mak conf
111
112gensend: gen
113 rsync -aivzc $(GENFILES) samba.org:/home/ftp/pub/rsync/generated-files/
114
115proto: proto.h-tstamp
116
117proto.h: proto.h-tstamp
118
119proto.h-tstamp: *.c lib/compat.c
120 perl mkproto.pl *.c lib/compat.c
121 touch proto.h-tstamp
122
123man: rsync.1 rsyncd.conf.5
124
125rsync.1: rsync.yo
126 yodl2man -o rsync.1 rsync.yo
127 -./tweak_manpage rsync.1
128
129rsyncd.conf.5: rsyncd.conf.yo
130 yodl2man -o rsyncd.conf.5 rsyncd.conf.yo
131 -./tweak_manpage rsyncd.conf.5
132
133clean: cleantests
134 rm -f *~ $(OBJS) $(TLS_OBJ) $(CHECK_PROGS) $(CHECK_OBJS) $(CHECK_SYMLINKS) \
135 mkrounding mkrounding.h rounding.h
136
137cleantests:
138 rm -rf ./testtmp*
139
140# We try to delete built files from both the source and build
141# directories, just in case somebody previously configured things in
142# the source directory.
143distclean: clean
144 rm -f Makefile config.h config.status
145 rm -f $(srcdir)/Makefile $(srcdir)/config.h $(srcdir)/config.status
146 rm -f config.cache config.log
147 rm -f $(srcdir)/config.cache $(srcdir)/config.log
148 rm -f shconfig $(srcdir)/shconfig
149 rm -f $(GENFILES)
150
151# this target is really just for my use. It only works on a limited
152# range of machines and is used to produce a list of potentially
153# dead (ie. unused) functions in the code. (tridge)
154finddead:
155 nm *.o */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt
156 nm *.o */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt
157 comm -13 nmused.txt nmfns.txt
158
159# 'check' is the GNU name, 'test' is the name for everybody else :-)
160.PHONY: check test
161
162test: check
163
164# There seems to be no standard way to specify some variables as
165# exported from a Makefile apart from listing them like this.
166
167# This depends on building rsync; if we need any helper programs it
168# should depend on them too.
169
170# We try to run the scripts with POSIX mode on, in the hope that will
171# catch Bash-isms earlier even if we're running on GNU. Of course, we
172# might lose in the future where POSIX diverges from old sh.
173
174check: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
175 rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh
176
177check29: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
178 rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh --protocol=29
179
180wildtest.o: wildtest.c lib/wildmatch.c rsync.h
181wildtest$(EXEEXT): wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@
182 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@ $(LIBS)
183
184testsuite/chown-fake.test:
185 ln -s chown.test $(srcdir)/testsuite/chown-fake.test
186
187testsuite/devices-fake.test:
188 ln -s devices.test $(srcdir)/testsuite/devices-fake.test
189
190# This does *not* depend on building or installing: you can use it to
191# check a version installed from a binary or some other source tree,
192# if you want.
193
194installcheck: $(CHECK_PROGS) $(CHECK_SYMLINKS)
195 POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin="$(bindir)/rsync$(EXEEXT)" srcdir="$(srcdir)" $(srcdir)/runtests.sh
196
197# TODO: Add 'dist' target; need to know which files will be included
198
199# Run the SPLINT (Secure Programming Lint) tool. <www.splint.org>
200.PHONY: splint
201splint:
202 splint +unixlib +gnuextensions -weak rsync.c
203
204
205rsync.dvi: doc/rsync.texinfo
206 texi2dvi -o $@ $<
207
208rsync.ps: rsync.dvi
209 dvips -ta4 -o $@ $<
210
211rsync.pdf: doc/rsync.texinfo
212 texi2dvi -o $@ --pdf $<
213
214
215doxygen:
216 cd $(srcdir) && rm dox/html/* && doxygen
217
218# for maintainers only
219doxygen-upload:
220 rsync -avzv $(srcdir)/dox/html/ --delete \
221 samba.org:/home/httpd/html/rsync/doxygen/head/