One build-farm system needs to fetch the proto.h* files too.
[rsync/rsync.git] / Makefile.in
CommitLineData
c627d613
AT
1# Makefile for rsync. This is processed by configure to produce the final
2# Makefile
3
6dd1782c 4prefix=@prefix@
9c3c30e5 5datarootdir=@datarootdir@
6dd1782c 6exec_prefix=@exec_prefix@
4040be4d
DD
7bindir=@bindir@
8mandir=@mandir@
c627d613 9
c627d613 10LIBS=@LIBS@
95a38e86 11CC=@CC@
ce2ac5ac 12CFLAGS=@CFLAGS@
a1cc591b
WD
13CPPFLAGS=@CPPFLAGS@
14EXEEXT=@EXEEXT@
6a48ca56 15LDFLAGS=@LDFLAGS@
95a38e86 16
c627d613 17INSTALLCMD=@INSTALL@
daa3d0e2 18INSTALLMAN=@INSTALL@
c627d613 19
d0390cd3 20srcdir=@srcdir@
4040be4d 21VPATH=$(srcdir)
c627d613
AT
22SHELL=/bin/sh
23
a358449a
MP
24VERSION=@VERSION@
25
c627d613
AT
26.SUFFIXES:
27.SUFFIXES: .c .o
28
613c2d44 29GENFILES=configure.sh config.h.in proto.h proto.h-tstamp rsync.1 rsyncd.conf.5
f0799273 30HEADERS=byteorder.h config.h errcode.h proto.h rsync.h ifuncs.h lib/pool_alloc.h
a0456b9c 31LIBOBJ=lib/wildmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o lib/md5.o \
16edf865 32 lib/permstring.o lib/pool_alloc.o lib/sysacls.o lib/sysxattrs.o @LIBOBJS@
81f5b275
WD
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
403dbc13
WD
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
354c9da6 37OBJS2=options.o io.o compat.o hlink.o token.o uidlist.o socket.o hashtable.o \
16edf865 38 fileio.o batch.o clientname.o chmod.o acls.o xattrs.o
b35d0d8e 39OBJS3=progress.o pipe.o
bcb7e502 40DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
1ac15cd8
MP
41popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
42 popt/popthelp.o popt/poptparse.o
5abe03d6 43OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) $(ZLIBOBJ) @BUILD_POPT@
c627d613 44
34273554 45TLS_OBJ = tls.o syscall.o lib/compat.o lib/snprintf.o lib/permstring.o lib/sysxattrs.o @BUILD_POPT@
7df0935a
MP
46
47# Programs we must have to run the test cases
7d9d5d94 48CHECK_PROGS = rsync$(EXEEXT) tls$(EXEEXT) getgroups$(EXEEXT) getfsdev$(EXEEXT) \
d7bf70f1 49 trimslash$(EXEEXT) t_unsafe$(EXEEXT) wildtest$(EXEEXT)
7df0935a 50
0b68d6b6
WD
51CHECK_SYMLINKS = testsuite/chown-fake.test testsuite/devices-fake.test
52
0c0a3e2d 53# Objects for CHECK_PROGS to clean
ef572356 54CHECK_OBJS=getgroups.o getfsdev.o t_stub.o t_unsafe.o trimslash.o wildtest.o
0c0a3e2d 55
366bd905 56# note that the -I. is needed to handle config.h when using VPATH
c627d613 57.c.o:
692da0b5 58@OBJ_SAVE@
a1cc591b 59 $(CC) -I. -I$(srcdir) $(CFLAGS) $(CPPFLAGS) -c $< @CC_SHOBJ_FLAG@
692da0b5 60@OBJ_RESTORE@
c627d613 61
b82ad950 62all: conf_stop rsync$(EXEEXT) @MAKE_MAN@
a87b3b2a 63
c627d613 64install: all
6aaf8d8c 65 -mkdir -p ${DESTDIR}${bindir}
af45f9e2 66 ${INSTALLCMD} ${INSTALL_STRIP} -m 755 rsync$(EXEEXT) ${DESTDIR}${bindir}
6aaf8d8c
MP
67 -mkdir -p ${DESTDIR}${mandir}/man1
68 -mkdir -p ${DESTDIR}${mandir}/man5
c8dccf8f
WD
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
4040be4d
DD
71
72install-strip:
af45f9e2 73 $(MAKE) INSTALL_STRIP='-s' install
c627d613 74
ec6e0bf0 75rsync$(EXEEXT): $(OBJS)
a1cc591b 76 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
4ff3d9d6 77
a1513439 78$(OBJS): $(HEADERS)
a5ce1eb1 79
403dbc13
WD
80flist.o: rounding.h
81
82rounding.h: mkrounding$(EXEEXT)
83 ./mkrounding$(EXEEXT) >rounding.h
84
9602b5cf 85mkrounding$(EXEEXT): mkrounding.c rsync.h
8576397c
WD
86 @sed '1,/^struct file_struct/d; /^}/,$$d' <$(srcdir)/rsync.h >mkrounding.h
87 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ -I. $(srcdir)/mkrounding.c
403dbc13
WD
88 @rm mkrounding.h
89
ec6e0bf0 90tls$(EXEEXT): $(TLS_OBJ)
34273554 91 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TLS_OBJ) $(LIBS)
7df0935a 92
ec6e0bf0 93getgroups$(EXEEXT): getgroups.o
435f1ed7 94 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getgroups.o $(LIBS)
4acbfa2a 95
ef572356
WD
96getfsdev$(EXEEXT): getfsdev.o
97 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getfsdev.o $(LIBS)
7d9d5d94 98
34bde8d5 99TRIMSLASH_OBJ = trimslash.o syscall.o lib/compat.o lib/snprintf.o
ec6e0bf0 100trimslash$(EXEEXT): $(TRIMSLASH_OBJ)
c127e8aa
MP
101 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TRIMSLASH_OBJ) $(LIBS)
102
9a933bc2 103T_UNSAFE_OBJ = t_unsafe.o syscall.o util.o t_stub.o lib/compat.o lib/snprintf.o
ec6e0bf0 104t_unsafe$(EXEEXT): $(T_UNSAFE_OBJ)
b35d0d8e
MP
105 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(T_UNSAFE_OBJ) $(LIBS)
106
225787a4
WD
107gen: conf proto.h man
108
b82ad950
WD
109gensend: gen
110 rsync -aivzc $(GENFILES) samba.org:/home/ftp/pub/rsync/generated-files/
111
225787a4
WD
112conf:
113 cd $(srcdir) && $(MAKE) -f prepare-source.mak conf
ed43d0a7 114
b82ad950
WD
115conf_stop: configure.sh config.h.in
116
117configure.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
6ec47d3d 123
225787a4
WD
124proto: proto.h-tstamp
125
126proto.h: proto.h-tstamp
5c77266d 127 @echo ' ' >/dev/null
225787a4
WD
128
129proto.h-tstamp: *.c lib/compat.c
130 perl mkproto.pl *.c lib/compat.c
225787a4
WD
131
132man: rsync.1 rsyncd.conf.5
133
134rsync.1: rsync.yo
135 yodl2man -o rsync.1 rsync.yo
136 -./tweak_manpage rsync.1
41059f75 137
225787a4
WD
138rsyncd.conf.5: rsyncd.conf.yo
139 yodl2man -o rsyncd.conf.5 rsyncd.conf.yo
140 -./tweak_manpage rsyncd.conf.5
c627d613 141
b4768a13 142clean: cleantests
0b68d6b6 143 rm -f *~ $(OBJS) $(TLS_OBJ) $(CHECK_PROGS) $(CHECK_OBJS) $(CHECK_SYMLINKS) \
403dbc13 144 mkrounding mkrounding.h rounding.h
9299c8f0
MP
145
146cleantests:
147 rm -rf ./testtmp*
c627d613 148
4610ac79
MP
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.
af21c12f 152distclean: clean
ef6122c6
WD
153 rm -f Makefile config.h config.status
154 rm -f $(srcdir)/Makefile $(srcdir)/config.h $(srcdir)/config.status
2a5904a5
MP
155 rm -f config.cache config.log
156 rm -f $(srcdir)/config.cache $(srcdir)/config.log
2a5904a5 157 rm -f shconfig $(srcdir)/shconfig
7f3b5293 158 rm -f $(GENFILES)
6e4fb64e
AT
159
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)
163finddead:
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
ef6122c6 166 comm -13 nmused.txt nmfns.txt
a4772a4d
MP
167
168# 'check' is the GNU name, 'test' is the name for everybody else :-)
169.PHONY: check test
170
171test: check
172
e7d29902
MP
173# There seems to be no standard way to specify some variables as
174# exported from a Makefile apart from listing them like this.
175
3a4c683f
MP
176# This depends on building rsync; if we need any helper programs it
177# should depend on them too.
178
42be5918
MP
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.
182
0b68d6b6 183check: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
3e88414e 184 rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh
e7d29902 185
0b68d6b6 186check29: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
9602b5cf
WD
187 rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh --protocol=29
188
2a1874cc 189wildtest.o: wildtest.c lib/wildmatch.c rsync.h
34273554 190wildtest$(EXEEXT): wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@
c5e29261 191 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@ $(LIBS)
d7bf70f1 192
0b68d6b6
WD
193testsuite/chown-fake.test:
194 ln -s chown.test $(srcdir)/testsuite/chown-fake.test
195
196testsuite/devices-fake.test:
197 ln -s devices.test $(srcdir)/testsuite/devices-fake.test
198
3a4c683f
MP
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.
202
1acb8f51 203installcheck: $(CHECK_PROGS) $(CHECK_SYMLINKS)
ec6e0bf0 204 POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin="$(bindir)/rsync$(EXEEXT)" srcdir="$(srcdir)" $(srcdir)/runtests.sh
e7d29902 205
cef40af2 206# TODO: Add 'dist' target; need to know which files will be included
6216ca2c 207
5648a819
MP
208# Run the SPLINT (Secure Programming Lint) tool. <www.splint.org>
209.PHONY: splint
ef6122c6 210splint:
5648a819
MP
211 splint +unixlib +gnuextensions -weak rsync.c
212
213
6216ca2c
MP
214rsync.dvi: doc/rsync.texinfo
215 texi2dvi -o $@ $<
216
ef6122c6 217rsync.ps: rsync.dvi
6216ca2c
MP
218 dvips -ta4 -o $@ $<
219
220rsync.pdf: doc/rsync.texinfo
221 texi2dvi -o $@ --pdf $<
b35d0d8e
MP
222
223
ef6122c6 224doxygen:
b35d0d8e
MP
225 cd $(srcdir) && rm dox/html/* && doxygen
226
227# for maintainers only
ef6122c6 228doxygen-upload:
b35d0d8e
MP
229 rsync -avzv $(srcdir)/dox/html/ --delete \
230 samba.org:/home/httpd/html/rsync/doxygen/head/