Save the value of the test for getaddrinfo defines in the config cache.
[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
AT
4prefix=@prefix@
5exec_prefix=@exec_prefix@
4040be4d
DD
6bindir=@bindir@
7mandir=@mandir@
c627d613 8
c627d613 9LIBS=@LIBS@
95a38e86 10CC=@CC@
ce2ac5ac 11CFLAGS=@CFLAGS@
a1cc591b
WD
12CPPFLAGS=@CPPFLAGS@
13EXEEXT=@EXEEXT@
6a48ca56 14LDFLAGS=@LDFLAGS@
95a38e86 15
c627d613 16INSTALLCMD=@INSTALL@
daa3d0e2 17INSTALLMAN=@INSTALL@
c627d613 18
d0390cd3 19srcdir=@srcdir@
4040be4d 20VPATH=$(srcdir)
c627d613
AT
21SHELL=/bin/sh
22
a358449a
MP
23VERSION=@VERSION@
24
c627d613
AT
25.SUFFIXES:
26.SUFFIXES: .c .o
27
8ef6b725 28LIBOBJ=lib/fnmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o \
ef6122c6 29 lib/permstring.o @LIBOBJS@
5914bf15
PM
30ZLIBOBJ=zlib/deflate.o zlib/infblock.o zlib/infcodes.o zlib/inffast.o \
31 zlib/inflate.o zlib/inftrees.o zlib/infutil.o zlib/trees.o \
ef6122c6
WD
32 zlib/zutil.o zlib/adler32.o
33OBJS1=rsync.o generator.o receiver.o cleanup.o sender.o exclude.o util.o \
34 main.o checksum.o match.o syscall.o log.o backup.o
35OBJS2=options.o flist.o io.o compat.o hlink.o token.o uidlist.o socket.o \
36 fileio.o batch.o clientname.o
b35d0d8e 37OBJS3=progress.o pipe.o
bcb7e502 38DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
1ac15cd8
MP
39popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
40 popt/popthelp.o popt/poptparse.o
b35d0d8e 41OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) $(ZLIBOBJ) @BUILD_POPT@
c627d613 42
ef6122c6 43TLS_OBJ = tls.o syscall.o lib/permstring.o
7df0935a
MP
44
45# Programs we must have to run the test cases
2abbf249
WD
46RSYNC_EXE=rsync$(EXEEXT)
47TLS_EXE=tls$(EXEEXT)
48GETGROUPS_EXE=getgroups$(EXEEXT)
49TRIMSLASH_EXE=trimslash$(EXEEXT)
50T_UNSAFE_EXE=t_unsafe$(EXEEXT)
51CHECK_PROGS=$(RSYNC_EXE) $(TLS_EXE) $(GETGROUPS_EXE) \
52 $(TRIMSLASH_EXE) $(T_UNSAFE_EXE)
7df0935a 53
0c0a3e2d
DD
54# Objects for CHECK_PROGS to clean
55CHECK_OBJS=getgroups.o t_stub.o t_unsafe.o trimslash.o
56
366bd905 57# note that the -I. is needed to handle config.h when using VPATH
c627d613 58.c.o:
692da0b5 59@OBJ_SAVE@
a1cc591b 60 $(CC) -I. -I$(srcdir) $(CFLAGS) $(CPPFLAGS) -c $< @CC_SHOBJ_FLAG@
692da0b5 61@OBJ_RESTORE@
c627d613 62
2abbf249 63all: $(RSYNC_EXE)
a87b3b2a
AT
64
65man: rsync.1 rsyncd.conf.5
c627d613
AT
66
67install: all
6aaf8d8c 68 -mkdir -p ${DESTDIR}${bindir}
2abbf249 69 ${INSTALLCMD} ${STRIP} -m 755 $(RSYNC_EXE) ${DESTDIR}${bindir}
6aaf8d8c
MP
70 -mkdir -p ${DESTDIR}${mandir}/man1
71 -mkdir -p ${DESTDIR}${mandir}/man5
72 ${INSTALLMAN} -m 644 $(srcdir)/rsync.1 ${DESTDIR}${mandir}/man1
73 ${INSTALLMAN} -m 644 $(srcdir)/rsyncd.conf.5 ${DESTDIR}${mandir}/man5
4040be4d
DD
74
75install-strip:
6aaf8d8c 76 $(MAKE) STRIP='-s' install
c627d613 77
2abbf249 78$(RSYNC_EXE): $(OBJS)
a1cc591b 79 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
4ff3d9d6 80
a5ce1eb1
DD
81$(OBJS): config.h
82
2abbf249 83$(TLS_EXE): $(TLS_OBJ)
956ff9ff 84 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TLS_OBJ) $(LIBS)
7df0935a 85
2abbf249 86$(GETGROUPS_EXE): getgroups.o
435f1ed7 87 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getgroups.o $(LIBS)
4acbfa2a 88
c127e8aa 89TRIMSLASH_OBJ = trimslash.o syscall.o
2abbf249 90$(TRIMSLASH_EXE): $(TRIMSLASH_OBJ)
c127e8aa
MP
91 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TRIMSLASH_OBJ) $(LIBS)
92
9a933bc2 93T_UNSAFE_OBJ = t_unsafe.o syscall.o util.o t_stub.o lib/compat.o lib/snprintf.o
2abbf249 94$(T_UNSAFE_EXE): $(T_UNSAFE_OBJ)
b35d0d8e
MP
95 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(T_UNSAFE_OBJ) $(LIBS)
96
e733c934
MP
97# I don't like these rules because CVS can skew the timestamps and
98# produce spurious warnings, and also make "make install" fail if the
99# source directory can no longer be found. Since we don't rebuild
100# automatically they're kind of lame anyhow.
101
102#Makefile: Makefile.in configure config.status
103# echo "WARNING: You need to run ./config.status --recheck"
4ff3d9d6 104
f62c17e3 105# don't actually run autoconf, just issue a warning
e733c934
MP
106#configure: configure.in
107# echo "WARNING: you need to rerun autoconf"
c627d613 108
48c1586c
MP
109$(srcdir)/rsync.1: $(srcdir)/rsync.yo
110 yodl2man -o $(srcdir)/rsync.1 $(srcdir)/rsync.yo
41059f75 111
48c1586c
MP
112$(srcdir)/rsyncd.conf.5: $(srcdir)/rsyncd.conf.yo
113 yodl2man -o $(srcdir)/rsyncd.conf.5 $(srcdir)/rsyncd.conf.yo
41059f75 114
c627d613 115proto:
1521eefb 116 cat $(srcdir)/*.c $(srcdir)/lib/compat.c | awk -f $(srcdir)/mkproto.awk > $(srcdir)/proto.h
c627d613 117
9299c8f0 118clean: cleantests
a1cc591b 119 rm -f *~ $(OBJS) $(TLS_OBJ) $(CHECK_PROGS) $(CHECK_OBJS)
9299c8f0
MP
120
121cleantests:
122 rm -rf ./testtmp*
c627d613 123
4610ac79
MP
124# We try to delete built files from both the source and build
125# directories, just in case somebody previously configured things in
126# the source directory.
af21c12f 127distclean: clean
ef6122c6
WD
128 rm -f Makefile config.h config.status
129 rm -f $(srcdir)/Makefile $(srcdir)/config.h $(srcdir)/config.status
2a5904a5
MP
130
131 rm -f config.cache config.log
132 rm -f $(srcdir)/config.cache $(srcdir)/config.log
133
134 rm -f shconfig $(srcdir)/shconfig
6e4fb64e
AT
135
136# this target is really just for my use. It only works on a limited
137# range of machines and is used to produce a list of potentially
138# dead (ie. unused) functions in the code. (tridge)
139finddead:
140 nm *.o */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt
141 nm *.o */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt
ef6122c6 142 comm -13 nmused.txt nmfns.txt
a4772a4d
MP
143
144# 'check' is the GNU name, 'test' is the name for everybody else :-)
145.PHONY: check test
146
147test: check
148
e7d29902
MP
149
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
7df0935a
MP
153# TODO: Tests that depend on built test aide programs like tls need to
154# know where the build directory is.
e7d29902 155
3a4c683f
MP
156# This depends on building rsync; if we need any helper programs it
157# should depend on them too.
158
42be5918
MP
159# We try to run the scripts with POSIX mode on, in the hope that will
160# catch Bash-isms earlier even if we're running on GNU. Of course, we
161# might lose in the future where POSIX diverges from old sh.
162
7df0935a 163check: all $(CHECK_PROGS)
2abbf249 164 POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin=`pwd`/$(RSYNC_EXE) srcdir="$(srcdir)" $(srcdir)/runtests.sh
e7d29902 165
3a4c683f
MP
166# This does *not* depend on building or installing: you can use it to
167# check a version installed from a binary or some other source tree,
168# if you want.
169
7df0935a 170installcheck: $(CHECK_PROGS)
2abbf249 171 POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin="$(bindir)/$(RSYNC_EXE)" srcdir="$(srcdir)" $(srcdir)/runtests.sh
e7d29902 172
cef40af2 173# TODO: Add 'dist' target; need to know which files will be included
6216ca2c 174
5648a819
MP
175# Run the SPLINT (Secure Programming Lint) tool. <www.splint.org>
176.PHONY: splint
ef6122c6 177splint:
5648a819
MP
178 splint +unixlib +gnuextensions -weak rsync.c
179
180
6216ca2c
MP
181rsync.dvi: doc/rsync.texinfo
182 texi2dvi -o $@ $<
183
ef6122c6 184rsync.ps: rsync.dvi
6216ca2c
MP
185 dvips -ta4 -o $@ $<
186
187rsync.pdf: doc/rsync.texinfo
188 texi2dvi -o $@ --pdf $<
b35d0d8e
MP
189
190
ef6122c6 191doxygen:
b35d0d8e
MP
192 cd $(srcdir) && rm dox/html/* && doxygen
193
194# for maintainers only
ef6122c6 195doxygen-upload:
b35d0d8e
MP
196 rsync -avzv $(srcdir)/dox/html/ --delete \
197 samba.org:/home/httpd/html/rsync/doxygen/head/