Adding the --fake-super option.
[rsync/rsync.git] / Makefile.in
... / ...
CommitLineData
1# Makefile for rsync. This is processed by configure to produce the final
2# Makefile
3
4prefix=@prefix@
5datarootdir=@datarootdir@
6exec_prefix=@exec_prefix@
7bindir=@bindir@
8mandir=@mandir@
9
10LIBS=@LIBS@
11CC=@CC@
12CFLAGS=@CFLAGS@
13CPPFLAGS=@CPPFLAGS@
14EXEEXT=@EXEEXT@
15LDFLAGS=@LDFLAGS@
16
17INSTALLCMD=@INSTALL@
18INSTALLMAN=@INSTALL@
19
20srcdir=@srcdir@
21VPATH=$(srcdir)
22SHELL=/bin/sh
23
24VERSION=@VERSION@
25
26.SUFFIXES:
27.SUFFIXES: .c .o
28
29HEADERS=byteorder.h config.h errcode.h proto.h rsync.h smb_acls.h lib/pool_alloc.h
30LIBOBJ=lib/wildmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o lib/md5.o \
31 lib/permstring.o lib/pool_alloc.o lib/sysacls.o lib/sysxattrs.o @LIBOBJS@
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
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
36OBJS2=options.o io.o compat.o hlink.o token.o uidlist.o socket.o \
37 fileio.o batch.o clientname.o chmod.o acls.o xattrs.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 lib/sysxattrs.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
77flist.o: rounding.h
78
79rounding.h: mkrounding$(EXEEXT)
80 ./mkrounding$(EXEEXT) >rounding.h
81
82mkrounding$(EXEEXT): mkrounding.c rsync.h
83 @sed '1,/^struct file_struct/d; /^}/,$$d' <$(srcdir)/rsync.h >mkrounding.h
84 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ -I. $(srcdir)/mkrounding.c
85 @rm mkrounding.h
86
87tls$(EXEEXT): $(TLS_OBJ)
88 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TLS_OBJ) $(LIBS)
89
90getgroups$(EXEEXT): getgroups.o
91 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getgroups.o $(LIBS)
92
93getfsdev$(EXEEXT): getfsdev.o
94 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getfsdev.o $(LIBS)
95
96TRIMSLASH_OBJ = trimslash.o syscall.o lib/compat.o lib/snprintf.o
97trimslash$(EXEEXT): $(TRIMSLASH_OBJ)
98 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TRIMSLASH_OBJ) $(LIBS)
99
100T_UNSAFE_OBJ = t_unsafe.o syscall.o util.o t_stub.o lib/compat.o lib/snprintf.o
101t_unsafe$(EXEEXT): $(T_UNSAFE_OBJ)
102 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(T_UNSAFE_OBJ) $(LIBS)
103
104gen:
105 cd $(srcdir) && $(MAKE) -f prepare-source.mak gen
106
107man:
108 cd $(srcdir) && $(MAKE) -f prepare-source.mak man
109
110proto:
111 cd $(srcdir) && $(MAKE) -f prepare-source.mak proto.h
112
113clean: cleantests
114 rm -f *~ $(OBJS) $(TLS_OBJ) $(CHECK_PROGS) $(CHECK_OBJS) \
115 mkrounding mkrounding.h rounding.h
116
117cleantests:
118 rm -rf ./testtmp*
119
120# We try to delete built files from both the source and build
121# directories, just in case somebody previously configured things in
122# the source directory.
123distclean: clean
124 rm -f Makefile config.h config.status
125 rm -f $(srcdir)/Makefile $(srcdir)/config.h $(srcdir)/config.status
126
127 rm -f config.cache config.log
128 rm -f $(srcdir)/config.cache $(srcdir)/config.log
129
130 rm -f shconfig $(srcdir)/shconfig
131
132# this target is really just for my use. It only works on a limited
133# range of machines and is used to produce a list of potentially
134# dead (ie. unused) functions in the code. (tridge)
135finddead:
136 nm *.o */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt
137 nm *.o */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt
138 comm -13 nmused.txt nmfns.txt
139
140# 'check' is the GNU name, 'test' is the name for everybody else :-)
141.PHONY: check test
142
143test: check
144
145
146# There seems to be no standard way to specify some variables as
147# exported from a Makefile apart from listing them like this.
148
149# This depends on building rsync; if we need any helper programs it
150# should depend on them too.
151
152# We try to run the scripts with POSIX mode on, in the hope that will
153# catch Bash-isms earlier even if we're running on GNU. Of course, we
154# might lose in the future where POSIX diverges from old sh.
155
156check: all $(CHECK_PROGS)
157 rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh
158
159check29: all $(CHECK_PROGS)
160 rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh --protocol=29
161
162wildtest.o: wildtest.c lib/wildmatch.c rsync.h
163wildtest$(EXEEXT): wildtest.o lib/compat.o lib/snprintf.o
164 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@ $(LIBS)
165
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
170installcheck: $(CHECK_PROGS)
171 POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin="$(bindir)/rsync$(EXEEXT)" srcdir="$(srcdir)" $(srcdir)/runtests.sh
172
173# TODO: Add 'dist' target; need to know which files will be included
174
175# Run the SPLINT (Secure Programming Lint) tool. <www.splint.org>
176.PHONY: splint
177splint:
178 splint +unixlib +gnuextensions -weak rsync.c
179
180
181rsync.dvi: doc/rsync.texinfo
182 texi2dvi -o $@ $<
183
184rsync.ps: rsync.dvi
185 dvips -ta4 -o $@ $<
186
187rsync.pdf: doc/rsync.texinfo
188 texi2dvi -o $@ --pdf $<
189
190
191doxygen:
192 cd $(srcdir) && rm dox/html/* && doxygen
193
194# for maintainers only
195doxygen-upload:
196 rsync -avzv $(srcdir)/dox/html/ --delete \
197 samba.org:/home/httpd/html/rsync/doxygen/head/