Commit | Line | Data |
---|---|---|
c627d613 AT |
1 | # Makefile for rsync. This is processed by configure to produce the final |
2 | # Makefile | |
3 | ||
6dd1782c | 4 | prefix=@prefix@ |
9c3c30e5 | 5 | datarootdir=@datarootdir@ |
6dd1782c | 6 | exec_prefix=@exec_prefix@ |
4040be4d DD |
7 | bindir=@bindir@ |
8 | mandir=@mandir@ | |
c627d613 | 9 | |
c627d613 | 10 | LIBS=@LIBS@ |
95a38e86 | 11 | CC=@CC@ |
ce2ac5ac | 12 | CFLAGS=@CFLAGS@ |
a1cc591b WD |
13 | CPPFLAGS=@CPPFLAGS@ |
14 | EXEEXT=@EXEEXT@ | |
6a48ca56 | 15 | LDFLAGS=@LDFLAGS@ |
95a38e86 | 16 | |
c627d613 | 17 | INSTALLCMD=@INSTALL@ |
daa3d0e2 | 18 | INSTALLMAN=@INSTALL@ |
c627d613 | 19 | |
d0390cd3 | 20 | srcdir=@srcdir@ |
4040be4d | 21 | VPATH=$(srcdir) |
c627d613 AT |
22 | SHELL=/bin/sh |
23 | ||
a358449a MP |
24 | VERSION=@VERSION@ |
25 | ||
c627d613 AT |
26 | .SUFFIXES: |
27 | .SUFFIXES: .c .o | |
28 | ||
613c2d44 | 29 | GENFILES=configure.sh config.h.in proto.h proto.h-tstamp rsync.1 rsyncd.conf.5 |
f0799273 | 30 | HEADERS=byteorder.h config.h errcode.h proto.h rsync.h ifuncs.h lib/pool_alloc.h |
a0456b9c | 31 | LIBOBJ=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 |
33 | ZLIBOBJ=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 |
35 | OBJS1=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 | 37 | OBJS2=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 | 39 | OBJS3=progress.o pipe.o |
bcb7e502 | 40 | DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o |
1ac15cd8 MP |
41 | popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \ |
42 | popt/popthelp.o popt/poptparse.o | |
5abe03d6 | 43 | OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) $(ZLIBOBJ) @BUILD_POPT@ |
c627d613 | 44 | |
34273554 | 45 | TLS_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 | 48 | CHECK_PROGS = rsync$(EXEEXT) tls$(EXEEXT) getgroups$(EXEEXT) getfsdev$(EXEEXT) \ |
d7bf70f1 | 49 | trimslash$(EXEEXT) t_unsafe$(EXEEXT) wildtest$(EXEEXT) |
7df0935a | 50 | |
0b68d6b6 WD |
51 | CHECK_SYMLINKS = testsuite/chown-fake.test testsuite/devices-fake.test |
52 | ||
0c0a3e2d | 53 | # Objects for CHECK_PROGS to clean |
fcb1068f | 54 | CHECK_OBJS=tls.o 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 | |
b82ad950 | 62 | all: conf_stop rsync$(EXEEXT) @MAKE_MAN@ |
a87b3b2a | 63 | |
c627d613 | 64 | install: 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 | |
72 | install-strip: | |
af45f9e2 | 73 | $(MAKE) INSTALL_STRIP='-s' install |
c627d613 | 74 | |
ec6e0bf0 | 75 | rsync$(EXEEXT): $(OBJS) |
a1cc591b | 76 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) |
4ff3d9d6 | 77 | |
fcb1068f WD |
78 | $(OBJS): $(HEADERS) |
79 | $(CHECK_OBJS): $(HEADERS) | |
80 | ||
403dbc13 WD |
81 | flist.o: rounding.h |
82 | ||
83 | rounding.h: mkrounding$(EXEEXT) | |
84 | ./mkrounding$(EXEEXT) >rounding.h | |
85 | ||
9602b5cf | 86 | mkrounding$(EXEEXT): mkrounding.c rsync.h |
8576397c WD |
87 | @sed '1,/^struct file_struct/d; /^}/,$$d' <$(srcdir)/rsync.h >mkrounding.h |
88 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ -I. $(srcdir)/mkrounding.c | |
403dbc13 WD |
89 | @rm mkrounding.h |
90 | ||
ec6e0bf0 | 91 | tls$(EXEEXT): $(TLS_OBJ) |
34273554 | 92 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TLS_OBJ) $(LIBS) |
7df0935a | 93 | |
ec6e0bf0 | 94 | getgroups$(EXEEXT): getgroups.o |
435f1ed7 | 95 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getgroups.o $(LIBS) |
4acbfa2a | 96 | |
ef572356 WD |
97 | getfsdev$(EXEEXT): getfsdev.o |
98 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getfsdev.o $(LIBS) | |
7d9d5d94 | 99 | |
34bde8d5 | 100 | TRIMSLASH_OBJ = trimslash.o syscall.o lib/compat.o lib/snprintf.o |
ec6e0bf0 | 101 | trimslash$(EXEEXT): $(TRIMSLASH_OBJ) |
c127e8aa MP |
102 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TRIMSLASH_OBJ) $(LIBS) |
103 | ||
9a933bc2 | 104 | T_UNSAFE_OBJ = t_unsafe.o syscall.o util.o t_stub.o lib/compat.o lib/snprintf.o |
ec6e0bf0 | 105 | t_unsafe$(EXEEXT): $(T_UNSAFE_OBJ) |
b35d0d8e MP |
106 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(T_UNSAFE_OBJ) $(LIBS) |
107 | ||
225787a4 WD |
108 | gen: conf proto.h man |
109 | ||
b82ad950 WD |
110 | gensend: gen |
111 | rsync -aivzc $(GENFILES) samba.org:/home/ftp/pub/rsync/generated-files/ | |
112 | ||
225787a4 WD |
113 | conf: |
114 | cd $(srcdir) && $(MAKE) -f prepare-source.mak conf | |
ed43d0a7 | 115 | |
b82ad950 WD |
116 | conf_stop: configure.sh config.h.in |
117 | ||
118 | configure.sh config.h.in: configure.in aclocal.m4 | |
119 | autoconf -o configure.sh | |
120 | autoheader && touch config.h.in | |
121 | @echo 'Configure files changed -- perhaps run:' | |
122 | @echo ' ./config.status --recheck; ./config.status' | |
123 | @exit 1 | |
6ec47d3d | 124 | |
225787a4 WD |
125 | proto: proto.h-tstamp |
126 | ||
127 | proto.h: proto.h-tstamp | |
5c77266d | 128 | @echo ' ' >/dev/null |
225787a4 | 129 | |
091b3459 | 130 | proto.h-tstamp: $(srcdir)/*.c $(srcdir)/lib/compat.c |
37adeae7 | 131 | perl $(srcdir)/mkproto.pl $(srcdir)/*.c $(srcdir)/lib/compat.c |
225787a4 WD |
132 | |
133 | man: rsync.1 rsyncd.conf.5 | |
134 | ||
135 | rsync.1: rsync.yo | |
37adeae7 WD |
136 | yodl2man -o rsync.1 $(srcdir)/rsync.yo |
137 | -$(srcdir)/tweak_manpage rsync.1 | |
41059f75 | 138 | |
225787a4 | 139 | rsyncd.conf.5: rsyncd.conf.yo |
37adeae7 WD |
140 | yodl2man -o rsyncd.conf.5 $(srcdir)/rsyncd.conf.yo |
141 | -$(srcdir)/tweak_manpage rsyncd.conf.5 | |
c627d613 | 142 | |
b4768a13 | 143 | clean: cleantests |
fcb1068f | 144 | rm -f *~ $(OBJS) $(CHECK_PROGS) $(CHECK_OBJS) $(CHECK_SYMLINKS) \ |
403dbc13 | 145 | mkrounding mkrounding.h rounding.h |
9299c8f0 MP |
146 | |
147 | cleantests: | |
148 | rm -rf ./testtmp* | |
c627d613 | 149 | |
4610ac79 MP |
150 | # We try to delete built files from both the source and build |
151 | # directories, just in case somebody previously configured things in | |
152 | # the source directory. | |
af21c12f | 153 | distclean: clean |
ef6122c6 WD |
154 | rm -f Makefile config.h config.status |
155 | rm -f $(srcdir)/Makefile $(srcdir)/config.h $(srcdir)/config.status | |
2a5904a5 MP |
156 | rm -f config.cache config.log |
157 | rm -f $(srcdir)/config.cache $(srcdir)/config.log | |
2a5904a5 | 158 | rm -f shconfig $(srcdir)/shconfig |
7f3b5293 | 159 | rm -f $(GENFILES) |
6e4fb64e AT |
160 | |
161 | # this target is really just for my use. It only works on a limited | |
162 | # range of machines and is used to produce a list of potentially | |
163 | # dead (ie. unused) functions in the code. (tridge) | |
164 | finddead: | |
165 | nm *.o */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt | |
166 | nm *.o */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt | |
ef6122c6 | 167 | comm -13 nmused.txt nmfns.txt |
a4772a4d MP |
168 | |
169 | # 'check' is the GNU name, 'test' is the name for everybody else :-) | |
170 | .PHONY: check test | |
171 | ||
172 | test: check | |
173 | ||
e7d29902 MP |
174 | # There seems to be no standard way to specify some variables as |
175 | # exported from a Makefile apart from listing them like this. | |
176 | ||
3a4c683f MP |
177 | # This depends on building rsync; if we need any helper programs it |
178 | # should depend on them too. | |
179 | ||
42be5918 MP |
180 | # We try to run the scripts with POSIX mode on, in the hope that will |
181 | # catch Bash-isms earlier even if we're running on GNU. Of course, we | |
182 | # might lose in the future where POSIX diverges from old sh. | |
183 | ||
0b68d6b6 | 184 | check: all $(CHECK_PROGS) $(CHECK_SYMLINKS) |
3e88414e | 185 | rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh |
e7d29902 | 186 | |
0b68d6b6 | 187 | check29: all $(CHECK_PROGS) $(CHECK_SYMLINKS) |
9602b5cf WD |
188 | rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh --protocol=29 |
189 | ||
07ad305e | 190 | wildtest.o: wildtest.c lib/wildmatch.c rsync.h config.h |
34273554 | 191 | wildtest$(EXEEXT): wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@ |
c5e29261 | 192 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@ $(LIBS) |
d7bf70f1 | 193 | |
0b68d6b6 WD |
194 | testsuite/chown-fake.test: |
195 | ln -s chown.test $(srcdir)/testsuite/chown-fake.test | |
196 | ||
197 | testsuite/devices-fake.test: | |
198 | ln -s devices.test $(srcdir)/testsuite/devices-fake.test | |
199 | ||
3a4c683f MP |
200 | # This does *not* depend on building or installing: you can use it to |
201 | # check a version installed from a binary or some other source tree, | |
202 | # if you want. | |
203 | ||
1acb8f51 | 204 | installcheck: $(CHECK_PROGS) $(CHECK_SYMLINKS) |
ec6e0bf0 | 205 | POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin="$(bindir)/rsync$(EXEEXT)" srcdir="$(srcdir)" $(srcdir)/runtests.sh |
e7d29902 | 206 | |
cef40af2 | 207 | # TODO: Add 'dist' target; need to know which files will be included |
6216ca2c | 208 | |
5648a819 MP |
209 | # Run the SPLINT (Secure Programming Lint) tool. <www.splint.org> |
210 | .PHONY: splint | |
ef6122c6 | 211 | splint: |
5648a819 MP |
212 | splint +unixlib +gnuextensions -weak rsync.c |
213 | ||
214 | ||
6216ca2c MP |
215 | rsync.dvi: doc/rsync.texinfo |
216 | texi2dvi -o $@ $< | |
217 | ||
ef6122c6 | 218 | rsync.ps: rsync.dvi |
6216ca2c MP |
219 | dvips -ta4 -o $@ $< |
220 | ||
221 | rsync.pdf: doc/rsync.texinfo | |
222 | texi2dvi -o $@ --pdf $< | |
b35d0d8e MP |
223 | |
224 | ||
ef6122c6 | 225 | doxygen: |
b35d0d8e MP |
226 | cd $(srcdir) && rm dox/html/* && doxygen |
227 | ||
228 | # for maintainers only | |
ef6122c6 | 229 | doxygen-upload: |
b35d0d8e MP |
230 | rsync -avzv $(srcdir)/dox/html/ --delete \ |
231 | samba.org:/home/httpd/html/rsync/doxygen/head/ |