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