Updated to work with git instead of cvs.
[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
7f3b5293 29GENFILES=configure.sh config.h.in proto.h 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
b4768a13 62all: rsync$(EXEEXT)
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
3ea7fc6c 107gen:
285edc91 108 cd $(srcdir) && $(MAKE) -f prepare-source.mak gen
ed43d0a7 109
6ec47d3d 110gensend: gen
7f3b5293 111 rsync -aivzc $(GENFILES) samba.org:/home/ftp/pub/rsync/generated-files/
6ec47d3d 112
3ea7fc6c 113man:
285edc91 114 cd $(srcdir) && $(MAKE) -f prepare-source.mak man
41059f75 115
c627d613 116proto:
285edc91 117 cd $(srcdir) && $(MAKE) -f prepare-source.mak proto.h
c627d613 118
b4768a13 119clean: cleantests
0b68d6b6 120 rm -f *~ $(OBJS) $(TLS_OBJ) $(CHECK_PROGS) $(CHECK_OBJS) $(CHECK_SYMLINKS) \
403dbc13 121 mkrounding mkrounding.h rounding.h
9299c8f0
MP
122
123cleantests:
124 rm -rf ./testtmp*
c627d613 125
4610ac79
MP
126# We try to delete built files from both the source and build
127# directories, just in case somebody previously configured things in
128# the source directory.
af21c12f 129distclean: clean
ef6122c6
WD
130 rm -f Makefile config.h config.status
131 rm -f $(srcdir)/Makefile $(srcdir)/config.h $(srcdir)/config.status
2a5904a5
MP
132 rm -f config.cache config.log
133 rm -f $(srcdir)/config.cache $(srcdir)/config.log
2a5904a5 134 rm -f shconfig $(srcdir)/shconfig
7f3b5293 135 rm -f $(GENFILES)
6e4fb64e
AT
136
137# this target is really just for my use. It only works on a limited
138# range of machines and is used to produce a list of potentially
139# dead (ie. unused) functions in the code. (tridge)
140finddead:
141 nm *.o */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt
142 nm *.o */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt
ef6122c6 143 comm -13 nmused.txt nmfns.txt
a4772a4d
MP
144
145# 'check' is the GNU name, 'test' is the name for everybody else :-)
146.PHONY: check test
147
148test: check
149
e7d29902
MP
150# There seems to be no standard way to specify some variables as
151# exported from a Makefile apart from listing them like this.
152
3a4c683f
MP
153# This depends on building rsync; if we need any helper programs it
154# should depend on them too.
155
42be5918
MP
156# We try to run the scripts with POSIX mode on, in the hope that will
157# catch Bash-isms earlier even if we're running on GNU. Of course, we
158# might lose in the future where POSIX diverges from old sh.
159
0b68d6b6 160check: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
3e88414e 161 rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh
e7d29902 162
0b68d6b6 163check29: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
9602b5cf
WD
164 rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh --protocol=29
165
2a1874cc 166wildtest.o: wildtest.c lib/wildmatch.c rsync.h
34273554 167wildtest$(EXEEXT): wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@
c5e29261 168 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@ $(LIBS)
d7bf70f1 169
0b68d6b6
WD
170testsuite/chown-fake.test:
171 ln -s chown.test $(srcdir)/testsuite/chown-fake.test
172
173testsuite/devices-fake.test:
174 ln -s devices.test $(srcdir)/testsuite/devices-fake.test
175
3a4c683f
MP
176# This does *not* depend on building or installing: you can use it to
177# check a version installed from a binary or some other source tree,
178# if you want.
179
1acb8f51 180installcheck: $(CHECK_PROGS) $(CHECK_SYMLINKS)
ec6e0bf0 181 POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin="$(bindir)/rsync$(EXEEXT)" srcdir="$(srcdir)" $(srcdir)/runtests.sh
e7d29902 182
cef40af2 183# TODO: Add 'dist' target; need to know which files will be included
6216ca2c 184
5648a819
MP
185# Run the SPLINT (Secure Programming Lint) tool. <www.splint.org>
186.PHONY: splint
ef6122c6 187splint:
5648a819
MP
188 splint +unixlib +gnuextensions -weak rsync.c
189
190
6216ca2c
MP
191rsync.dvi: doc/rsync.texinfo
192 texi2dvi -o $@ $<
193
ef6122c6 194rsync.ps: rsync.dvi
6216ca2c
MP
195 dvips -ta4 -o $@ $<
196
197rsync.pdf: doc/rsync.texinfo
198 texi2dvi -o $@ --pdf $<
b35d0d8e
MP
199
200
ef6122c6 201doxygen:
b35d0d8e
MP
202 cd $(srcdir) && rm dox/html/* && doxygen
203
204# for maintainers only
ef6122c6 205doxygen-upload:
b35d0d8e
MP
206 rsync -avzv $(srcdir)/dox/html/ --delete \
207 samba.org:/home/httpd/html/rsync/doxygen/head/