Preparing for release of 3.0.0pre1
[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
f0799273 29HEADERS=byteorder.h config.h errcode.h proto.h rsync.h ifuncs.h lib/pool_alloc.h
a0456b9c 30LIBOBJ=lib/wildmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o lib/md5.o \
16edf865 31 lib/permstring.o lib/pool_alloc.o lib/sysacls.o lib/sysxattrs.o @LIBOBJS@
81f5b275
WD
32ZLIBOBJ=zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o \
33 zlib/trees.o zlib/zutil.o zlib/adler32.o zlib/compress.o zlib/crc32.o
403dbc13
WD
34OBJS1=flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o \
35 util.o main.o checksum.o match.o syscall.o log.o backup.o
354c9da6 36OBJS2=options.o io.o compat.o hlink.o token.o uidlist.o socket.o hashtable.o \
16edf865 37 fileio.o batch.o clientname.o chmod.o acls.o xattrs.o
b35d0d8e 38OBJS3=progress.o pipe.o
bcb7e502 39DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
1ac15cd8
MP
40popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
41 popt/popthelp.o popt/poptparse.o
5abe03d6 42OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) $(ZLIBOBJ) @BUILD_POPT@
c627d613 43
34273554 44TLS_OBJ = tls.o syscall.o lib/compat.o lib/snprintf.o lib/permstring.o lib/sysxattrs.o @BUILD_POPT@
7df0935a
MP
45
46# Programs we must have to run the test cases
7d9d5d94 47CHECK_PROGS = rsync$(EXEEXT) tls$(EXEEXT) getgroups$(EXEEXT) getfsdev$(EXEEXT) \
d7bf70f1 48 trimslash$(EXEEXT) t_unsafe$(EXEEXT) wildtest$(EXEEXT)
7df0935a 49
0b68d6b6
WD
50CHECK_SYMLINKS = testsuite/chown-fake.test testsuite/devices-fake.test
51
0c0a3e2d 52# Objects for CHECK_PROGS to clean
ef572356 53CHECK_OBJS=getgroups.o getfsdev.o t_stub.o t_unsafe.o trimslash.o wildtest.o
0c0a3e2d 54
366bd905 55# note that the -I. is needed to handle config.h when using VPATH
c627d613 56.c.o:
692da0b5 57@OBJ_SAVE@
a1cc591b 58 $(CC) -I. -I$(srcdir) $(CFLAGS) $(CPPFLAGS) -c $< @CC_SHOBJ_FLAG@
692da0b5 59@OBJ_RESTORE@
c627d613 60
b4768a13 61all: rsync$(EXEEXT)
a87b3b2a 62
c627d613 63install: all
6aaf8d8c 64 -mkdir -p ${DESTDIR}${bindir}
af45f9e2 65 ${INSTALLCMD} ${INSTALL_STRIP} -m 755 rsync$(EXEEXT) ${DESTDIR}${bindir}
6aaf8d8c
MP
66 -mkdir -p ${DESTDIR}${mandir}/man1
67 -mkdir -p ${DESTDIR}${mandir}/man5
68 ${INSTALLMAN} -m 644 $(srcdir)/rsync.1 ${DESTDIR}${mandir}/man1
69 ${INSTALLMAN} -m 644 $(srcdir)/rsyncd.conf.5 ${DESTDIR}${mandir}/man5
4040be4d
DD
70
71install-strip:
af45f9e2 72 $(MAKE) INSTALL_STRIP='-s' install
c627d613 73
ec6e0bf0 74rsync$(EXEEXT): $(OBJS)
a1cc591b 75 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
4ff3d9d6 76
a1513439 77$(OBJS): $(HEADERS)
a5ce1eb1 78
403dbc13
WD
79flist.o: rounding.h
80
81rounding.h: mkrounding$(EXEEXT)
82 ./mkrounding$(EXEEXT) >rounding.h
83
9602b5cf 84mkrounding$(EXEEXT): mkrounding.c rsync.h
8576397c
WD
85 @sed '1,/^struct file_struct/d; /^}/,$$d' <$(srcdir)/rsync.h >mkrounding.h
86 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ -I. $(srcdir)/mkrounding.c
403dbc13
WD
87 @rm mkrounding.h
88
ec6e0bf0 89tls$(EXEEXT): $(TLS_OBJ)
34273554 90 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TLS_OBJ) $(LIBS)
7df0935a 91
ec6e0bf0 92getgroups$(EXEEXT): getgroups.o
435f1ed7 93 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getgroups.o $(LIBS)
4acbfa2a 94
ef572356
WD
95getfsdev$(EXEEXT): getfsdev.o
96 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getfsdev.o $(LIBS)
7d9d5d94 97
34bde8d5 98TRIMSLASH_OBJ = trimslash.o syscall.o lib/compat.o lib/snprintf.o
ec6e0bf0 99trimslash$(EXEEXT): $(TRIMSLASH_OBJ)
c127e8aa
MP
100 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TRIMSLASH_OBJ) $(LIBS)
101
9a933bc2 102T_UNSAFE_OBJ = t_unsafe.o syscall.o util.o t_stub.o lib/compat.o lib/snprintf.o
ec6e0bf0 103t_unsafe$(EXEEXT): $(T_UNSAFE_OBJ)
b35d0d8e
MP
104 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(T_UNSAFE_OBJ) $(LIBS)
105
3ea7fc6c 106gen:
285edc91 107 cd $(srcdir) && $(MAKE) -f prepare-source.mak gen
ed43d0a7 108
3ea7fc6c 109man:
285edc91 110 cd $(srcdir) && $(MAKE) -f prepare-source.mak man
41059f75 111
c627d613 112proto:
285edc91 113 cd $(srcdir) && $(MAKE) -f prepare-source.mak proto.h
c627d613 114
b4768a13 115clean: cleantests
0b68d6b6 116 rm -f *~ $(OBJS) $(TLS_OBJ) $(CHECK_PROGS) $(CHECK_OBJS) $(CHECK_SYMLINKS) \
403dbc13 117 mkrounding mkrounding.h rounding.h
9299c8f0
MP
118
119cleantests:
120 rm -rf ./testtmp*
c627d613 121
4610ac79
MP
122# We try to delete built files from both the source and build
123# directories, just in case somebody previously configured things in
124# the source directory.
af21c12f 125distclean: clean
ef6122c6
WD
126 rm -f Makefile config.h config.status
127 rm -f $(srcdir)/Makefile $(srcdir)/config.h $(srcdir)/config.status
2a5904a5
MP
128
129 rm -f config.cache config.log
130 rm -f $(srcdir)/config.cache $(srcdir)/config.log
131
132 rm -f shconfig $(srcdir)/shconfig
6e4fb64e
AT
133
134# this target is really just for my use. It only works on a limited
135# range of machines and is used to produce a list of potentially
136# dead (ie. unused) functions in the code. (tridge)
137finddead:
138 nm *.o */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt
139 nm *.o */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt
ef6122c6 140 comm -13 nmused.txt nmfns.txt
a4772a4d
MP
141
142# 'check' is the GNU name, 'test' is the name for everybody else :-)
143.PHONY: check test
144
145test: check
146
e7d29902
MP
147# There seems to be no standard way to specify some variables as
148# exported from a Makefile apart from listing them like this.
149
3a4c683f
MP
150# This depends on building rsync; if we need any helper programs it
151# should depend on them too.
152
42be5918
MP
153# We try to run the scripts with POSIX mode on, in the hope that will
154# catch Bash-isms earlier even if we're running on GNU. Of course, we
155# might lose in the future where POSIX diverges from old sh.
156
0b68d6b6 157check: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
3e88414e 158 rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh
e7d29902 159
0b68d6b6 160check29: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
9602b5cf
WD
161 rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh --protocol=29
162
2a1874cc 163wildtest.o: wildtest.c lib/wildmatch.c rsync.h
34273554 164wildtest$(EXEEXT): wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@
c5e29261 165 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@ $(LIBS)
d7bf70f1 166
0b68d6b6
WD
167testsuite/chown-fake.test:
168 ln -s chown.test $(srcdir)/testsuite/chown-fake.test
169
170testsuite/devices-fake.test:
171 ln -s devices.test $(srcdir)/testsuite/devices-fake.test
172
3a4c683f
MP
173# This does *not* depend on building or installing: you can use it to
174# check a version installed from a binary or some other source tree,
175# if you want.
176
1acb8f51 177installcheck: $(CHECK_PROGS) $(CHECK_SYMLINKS)
ec6e0bf0 178 POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin="$(bindir)/rsync$(EXEEXT)" srcdir="$(srcdir)" $(srcdir)/runtests.sh
e7d29902 179
cef40af2 180# TODO: Add 'dist' target; need to know which files will be included
6216ca2c 181
5648a819
MP
182# Run the SPLINT (Secure Programming Lint) tool. <www.splint.org>
183.PHONY: splint
ef6122c6 184splint:
5648a819
MP
185 splint +unixlib +gnuextensions -weak rsync.c
186
187
6216ca2c
MP
188rsync.dvi: doc/rsync.texinfo
189 texi2dvi -o $@ $<
190
ef6122c6 191rsync.ps: rsync.dvi
6216ca2c
MP
192 dvips -ta4 -o $@ $<
193
194rsync.pdf: doc/rsync.texinfo
195 texi2dvi -o $@ --pdf $<
b35d0d8e
MP
196
197
ef6122c6 198doxygen:
b35d0d8e
MP
199 cd $(srcdir) && rm dox/html/* && doxygen
200
201# for maintainers only
ef6122c6 202doxygen-upload:
b35d0d8e
MP
203 rsync -avzv $(srcdir)/dox/html/ --delete \
204 samba.org:/home/httpd/html/rsync/doxygen/head/