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 | ||
54fd3e50 | 29 | HEADERS=byteorder.h config.h errcode.h proto.h rsync.h lib/pool_alloc.h |
3c0b1ebf | 30 | LIBOBJ=lib/wildmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o \ |
9935066b | 31 | lib/permstring.o lib/pool_alloc.o @LIBOBJS@ |
81f5b275 WD |
32 | ZLIBOBJ=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 | |
403dbc13 WD |
34 | OBJS1=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 | |
36 | OBJS2=options.o io.o compat.o hlink.o token.o uidlist.o socket.o \ | |
0582cdae | 37 | fileio.o batch.o clientname.o chmod.o |
b35d0d8e | 38 | OBJS3=progress.o pipe.o |
bcb7e502 | 39 | DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o |
1ac15cd8 MP |
40 | popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \ |
41 | popt/popthelp.o popt/poptparse.o | |
5abe03d6 | 42 | OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) $(ZLIBOBJ) @BUILD_POPT@ |
c627d613 | 43 | |
34bde8d5 | 44 | TLS_OBJ = tls.o syscall.o lib/compat.o lib/snprintf.o lib/permstring.o |
7df0935a MP |
45 | |
46 | # Programs we must have to run the test cases | |
7d9d5d94 | 47 | CHECK_PROGS = rsync$(EXEEXT) tls$(EXEEXT) getgroups$(EXEEXT) getfsdev$(EXEEXT) \ |
d7bf70f1 | 48 | trimslash$(EXEEXT) t_unsafe$(EXEEXT) wildtest$(EXEEXT) |
7df0935a | 49 | |
0c0a3e2d | 50 | # Objects for CHECK_PROGS to clean |
ef572356 | 51 | CHECK_OBJS=getgroups.o getfsdev.o t_stub.o t_unsafe.o trimslash.o wildtest.o |
0c0a3e2d | 52 | |
366bd905 | 53 | # note that the -I. is needed to handle config.h when using VPATH |
c627d613 | 54 | .c.o: |
692da0b5 | 55 | @OBJ_SAVE@ |
a1cc591b | 56 | $(CC) -I. -I$(srcdir) $(CFLAGS) $(CPPFLAGS) -c $< @CC_SHOBJ_FLAG@ |
692da0b5 | 57 | @OBJ_RESTORE@ |
c627d613 | 58 | |
b4768a13 | 59 | all: rsync$(EXEEXT) |
a87b3b2a | 60 | |
c627d613 | 61 | install: all |
6aaf8d8c | 62 | -mkdir -p ${DESTDIR}${bindir} |
af45f9e2 | 63 | ${INSTALLCMD} ${INSTALL_STRIP} -m 755 rsync$(EXEEXT) ${DESTDIR}${bindir} |
6aaf8d8c MP |
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 | |
4040be4d DD |
68 | |
69 | install-strip: | |
af45f9e2 | 70 | $(MAKE) INSTALL_STRIP='-s' install |
c627d613 | 71 | |
ec6e0bf0 | 72 | rsync$(EXEEXT): $(OBJS) |
a1cc591b | 73 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) |
4ff3d9d6 | 74 | |
a1513439 | 75 | $(OBJS): $(HEADERS) |
a5ce1eb1 | 76 | |
403dbc13 WD |
77 | flist.o: rounding.h |
78 | ||
79 | rounding.h: mkrounding$(EXEEXT) | |
80 | ./mkrounding$(EXEEXT) >rounding.h | |
81 | ||
9602b5cf | 82 | mkrounding$(EXEEXT): mkrounding.c rsync.h |
403dbc13 WD |
83 | @sed '1,/^struct file_struct/d; /^}/,$$d' <rsync.h >mkrounding.h |
84 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ mkrounding.c | |
85 | @rm mkrounding.h | |
86 | ||
ec6e0bf0 | 87 | tls$(EXEEXT): $(TLS_OBJ) |
956ff9ff | 88 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TLS_OBJ) $(LIBS) |
7df0935a | 89 | |
ec6e0bf0 | 90 | getgroups$(EXEEXT): getgroups.o |
435f1ed7 | 91 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getgroups.o $(LIBS) |
4acbfa2a | 92 | |
ef572356 WD |
93 | getfsdev$(EXEEXT): getfsdev.o |
94 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getfsdev.o $(LIBS) | |
7d9d5d94 | 95 | |
34bde8d5 | 96 | TRIMSLASH_OBJ = trimslash.o syscall.o lib/compat.o lib/snprintf.o |
ec6e0bf0 | 97 | trimslash$(EXEEXT): $(TRIMSLASH_OBJ) |
c127e8aa MP |
98 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TRIMSLASH_OBJ) $(LIBS) |
99 | ||
9a933bc2 | 100 | T_UNSAFE_OBJ = t_unsafe.o syscall.o util.o t_stub.o lib/compat.o lib/snprintf.o |
ec6e0bf0 | 101 | t_unsafe$(EXEEXT): $(T_UNSAFE_OBJ) |
b35d0d8e MP |
102 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(T_UNSAFE_OBJ) $(LIBS) |
103 | ||
3ea7fc6c | 104 | gen: |
285edc91 | 105 | cd $(srcdir) && $(MAKE) -f prepare-source.mak gen |
ed43d0a7 | 106 | |
3ea7fc6c | 107 | man: |
285edc91 | 108 | cd $(srcdir) && $(MAKE) -f prepare-source.mak man |
41059f75 | 109 | |
c627d613 | 110 | proto: |
285edc91 | 111 | cd $(srcdir) && $(MAKE) -f prepare-source.mak proto.h |
c627d613 | 112 | |
b4768a13 | 113 | clean: cleantests |
403dbc13 WD |
114 | rm -f *~ $(OBJS) $(TLS_OBJ) $(CHECK_PROGS) $(CHECK_OBJS) \ |
115 | mkrounding mkrounding.h rounding.h | |
9299c8f0 MP |
116 | |
117 | cleantests: | |
118 | rm -rf ./testtmp* | |
c627d613 | 119 | |
4610ac79 MP |
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. | |
af21c12f | 123 | distclean: clean |
ef6122c6 WD |
124 | rm -f Makefile config.h config.status |
125 | rm -f $(srcdir)/Makefile $(srcdir)/config.h $(srcdir)/config.status | |
2a5904a5 MP |
126 | |
127 | rm -f config.cache config.log | |
128 | rm -f $(srcdir)/config.cache $(srcdir)/config.log | |
129 | ||
130 | rm -f shconfig $(srcdir)/shconfig | |
6e4fb64e AT |
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) | |
135 | finddead: | |
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 | |
ef6122c6 | 138 | comm -13 nmused.txt nmfns.txt |
a4772a4d MP |
139 | |
140 | # 'check' is the GNU name, 'test' is the name for everybody else :-) | |
141 | .PHONY: check test | |
142 | ||
143 | test: check | |
144 | ||
e7d29902 MP |
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 | ||
3a4c683f MP |
149 | # This depends on building rsync; if we need any helper programs it |
150 | # should depend on them too. | |
151 | ||
42be5918 MP |
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 | ||
7df0935a | 156 | check: all $(CHECK_PROGS) |
3e88414e | 157 | rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh |
e7d29902 | 158 | |
9602b5cf WD |
159 | check29: all $(CHECK_PROGS) |
160 | rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh --protocol=29 | |
161 | ||
2a1874cc | 162 | wildtest.o: wildtest.c lib/wildmatch.c rsync.h |
c5e29261 WD |
163 | wildtest$(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) | |
d7bf70f1 | 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 | 170 | installcheck: $(CHECK_PROGS) |
ec6e0bf0 | 171 | POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin="$(bindir)/rsync$(EXEEXT)" 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 | 177 | splint: |
5648a819 MP |
178 | splint +unixlib +gnuextensions -weak rsync.c |
179 | ||
180 | ||
6216ca2c MP |
181 | rsync.dvi: doc/rsync.texinfo |
182 | texi2dvi -o $@ $< | |
183 | ||
ef6122c6 | 184 | rsync.ps: rsync.dvi |
6216ca2c MP |
185 | dvips -ta4 -o $@ $< |
186 | ||
187 | rsync.pdf: doc/rsync.texinfo | |
188 | texi2dvi -o $@ --pdf $< | |
b35d0d8e MP |
189 | |
190 | ||
ef6122c6 | 191 | doxygen: |
b35d0d8e MP |
192 | cd $(srcdir) && rm dox/html/* && doxygen |
193 | ||
194 | # for maintainers only | |
ef6122c6 | 195 | doxygen-upload: |
b35d0d8e MP |
196 | rsync -avzv $(srcdir)/dox/html/ --delete \ |
197 | samba.org:/home/httpd/html/rsync/doxygen/head/ |