If there is no lchown(), don't try to set the user & group of a symlink.
[rsync/rsync.git] / Makefile.in
... / ...
CommitLineData
1# Makefile for rsync. This is processed by configure to produce the final
2# Makefile
3
4prefix=@prefix@
5exec_prefix=@exec_prefix@
6bindir=@bindir@
7mandir=@mandir@
8
9LIBS=@LIBS@
10CC=@CC@
11CFLAGS=@CFLAGS@
12CPPFLAGS=@CPPFLAGS@
13EXEEXT=@EXEEXT@
14LDFLAGS=@LDFLAGS@
15
16INSTALLCMD=@INSTALL@
17INSTALLMAN=@INSTALL@
18
19srcdir=@srcdir@
20VPATH=$(srcdir)
21SHELL=/bin/sh
22
23VERSION=@VERSION@
24
25.SUFFIXES:
26.SUFFIXES: .c .o
27
28HEADERS=byteorder.h config.h errcode.h proto.h rsync.h lib/pool_alloc.h
29LIBOBJ=lib/wildmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o \
30 lib/permstring.o lib/pool_alloc.o @LIBOBJS@
31ZLIBOBJ=zlib/deflate.o zlib/infblock.o zlib/infcodes.o zlib/inffast.o \
32 zlib/inflate.o zlib/inftrees.o zlib/infutil.o zlib/trees.o \
33 zlib/zutil.o zlib/adler32.o
34OBJS1=rsync.o generator.o receiver.o cleanup.o sender.o exclude.o util.o \
35 main.o checksum.o match.o syscall.o log.o backup.o
36OBJS2=options.o flist.o io.o compat.o hlink.o token.o uidlist.o socket.o \
37 fileio.o batch.o clientname.o
38OBJS3=progress.o pipe.o
39DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
40popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
41 popt/popthelp.o popt/poptparse.o
42OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) $(ZLIBOBJ) @BUILD_POPT@
43
44TLS_OBJ = tls.o syscall.o lib/compat.o lib/snprintf.o lib/permstring.o
45
46# Programs we must have to run the test cases
47CHECK_PROGS = rsync$(EXEEXT) tls$(EXEEXT) getgroups$(EXEEXT) getfsdev$(EXEEXT) \
48 trimslash$(EXEEXT) t_unsafe$(EXEEXT) wildtest$(EXEEXT)
49
50# Objects for CHECK_PROGS to clean
51CHECK_OBJS=getgroups.o getfsdev.o t_stub.o t_unsafe.o trimslash.o wildtest.o
52
53# note that the -I. is needed to handle config.h when using VPATH
54.c.o:
55@OBJ_SAVE@
56 $(CC) -I. -I$(srcdir) $(CFLAGS) $(CPPFLAGS) -c $< @CC_SHOBJ_FLAG@
57@OBJ_RESTORE@
58
59all: rsync$(EXEEXT)
60
61install: all
62 -mkdir -p ${DESTDIR}${bindir}
63 ${INSTALLCMD} ${INSTALL_STRIP} -m 755 rsync$(EXEEXT) ${DESTDIR}${bindir}
64 -mkdir -p ${DESTDIR}${mandir}/man1
65 -mkdir -p ${DESTDIR}${mandir}/man5
66 ${INSTALLMAN} -m 644 $(srcdir)/rsync.1 ${DESTDIR}${mandir}/man1
67 ${INSTALLMAN} -m 644 $(srcdir)/rsyncd.conf.5 ${DESTDIR}${mandir}/man5
68
69install-strip:
70 $(MAKE) INSTALL_STRIP='-s' install
71
72rsync$(EXEEXT): $(OBJS)
73 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
74
75$(OBJS): $(HEADERS)
76
77tls$(EXEEXT): $(TLS_OBJ)
78 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TLS_OBJ) $(LIBS)
79
80getgroups$(EXEEXT): getgroups.o
81 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getgroups.o $(LIBS)
82
83getfsdev$(EXEEXT): getfsdev.o
84 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getfsdev.o $(LIBS)
85
86TRIMSLASH_OBJ = trimslash.o syscall.o lib/compat.o lib/snprintf.o
87trimslash$(EXEEXT): $(TRIMSLASH_OBJ)
88 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TRIMSLASH_OBJ) $(LIBS)
89
90T_UNSAFE_OBJ = t_unsafe.o syscall.o util.o t_stub.o lib/compat.o lib/snprintf.o
91t_unsafe$(EXEEXT): $(T_UNSAFE_OBJ)
92 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(T_UNSAFE_OBJ) $(LIBS)
93
94gen: $(srcdir)/configure $(srcdir)/config.h.in proto man
95
96man: $(srcdir)/rsync.1 $(srcdir)/rsyncd.conf.5
97
98$(srcdir)/configure: $(srcdir)/configure.in $(srcdir)/aclocal.m4
99 cd $(srcdir); autoconf
100
101$(srcdir)/config.h.in: $(srcdir)/configure.in $(srcdir)/aclocal.m4
102 cd $(srcdir); autoheader
103
104$(srcdir)/rsync.1: $(srcdir)/rsync.yo
105 yodl2man -o $(srcdir)/rsync.1 $(srcdir)/rsync.yo
106
107$(srcdir)/rsyncd.conf.5: $(srcdir)/rsyncd.conf.yo
108 yodl2man -o $(srcdir)/rsyncd.conf.5 $(srcdir)/rsyncd.conf.yo
109
110proto:
111 cat $(srcdir)/*.c $(srcdir)/lib/compat.c | awk -f $(srcdir)/mkproto.awk >$(srcdir)/proto.h.new
112 if diff $(srcdir)/proto.h $(srcdir)/proto.h.new >/dev/null; then \
113 rm $(srcdir)/proto.h.new; \
114 else \
115 mv $(srcdir)/proto.h.new $(srcdir)/proto.h; \
116 fi
117
118clean: cleantests
119 rm -f *~ $(OBJS) $(TLS_OBJ) $(CHECK_PROGS) $(CHECK_OBJS)
120
121cleantests:
122 rm -rf ./testtmp*
123
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.
127distclean: clean
128 rm -f Makefile config.h config.status
129 rm -f $(srcdir)/Makefile $(srcdir)/config.h $(srcdir)/config.status
130
131 rm -f config.cache config.log
132 rm -f $(srcdir)/config.cache $(srcdir)/config.log
133
134 rm -f shconfig $(srcdir)/shconfig
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
142 comm -13 nmused.txt nmfns.txt
143
144# 'check' is the GNU name, 'test' is the name for everybody else :-)
145.PHONY: check test
146
147test: check
148
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
153# This depends on building rsync; if we need any helper programs it
154# should depend on them too.
155
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
160check: all $(CHECK_PROGS)
161 POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin=`pwd`/rsync$(EXEEXT) srcdir="$(srcdir)" $(srcdir)/runtests.sh
162
163wildtest.o: wildtest.c lib/wildmatch.c rsync.h
164wildtest$(EXEEXT): wildtest.o
165 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ wildtest.o @BUILD_POPT@ $(LIBS)
166
167# This does *not* depend on building or installing: you can use it to
168# check a version installed from a binary or some other source tree,
169# if you want.
170
171installcheck: $(CHECK_PROGS)
172 POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin="$(bindir)/rsync$(EXEEXT)" srcdir="$(srcdir)" $(srcdir)/runtests.sh
173
174# TODO: Add 'dist' target; need to know which files will be included
175
176# Run the SPLINT (Secure Programming Lint) tool. <www.splint.org>
177.PHONY: splint
178splint:
179 splint +unixlib +gnuextensions -weak rsync.c
180
181
182rsync.dvi: doc/rsync.texinfo
183 texi2dvi -o $@ $<
184
185rsync.ps: rsync.dvi
186 dvips -ta4 -o $@ $<
187
188rsync.pdf: doc/rsync.texinfo
189 texi2dvi -o $@ --pdf $<
190
191
192doxygen:
193 cd $(srcdir) && rm dox/html/* && doxygen
194
195# for maintainers only
196doxygen-upload:
197 rsync -avzv $(srcdir)/dox/html/ --delete \
198 samba.org:/home/httpd/html/rsync/doxygen/head/