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@ |
6a48ca56 | 12 | LDFLAGS=@LDFLAGS@ |
95a38e86 | 13 | |
c627d613 AT |
14 | INSTALLCMD=@INSTALL@ |
15 | ||
d0390cd3 | 16 | srcdir=@srcdir@ |
4040be4d | 17 | VPATH=$(srcdir) |
c627d613 AT |
18 | SHELL=/bin/sh |
19 | ||
a358449a MP |
20 | VERSION=@VERSION@ |
21 | ||
c627d613 AT |
22 | .SUFFIXES: |
23 | .SUFFIXES: .c .o | |
24 | ||
8ef6b725 | 25 | LIBOBJ=lib/fnmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o \ |
77ba4cc2 | 26 | lib/permstring.o \ |
06963d0f | 27 | @LIBOBJS@ |
5914bf15 PM |
28 | ZLIBOBJ=zlib/deflate.o zlib/infblock.o zlib/infcodes.o zlib/inffast.o \ |
29 | zlib/inflate.o zlib/inftrees.o zlib/infutil.o zlib/trees.o \ | |
8de330a3 | 30 | zlib/zutil.o zlib/adler32.o |
3d19b4c8 | 31 | 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 |
6902ed17 | 32 | OBJS2=options.o flist.o io.o compat.o hlink.o token.o uidlist.o socket.o fileio.o batch.o |
bcb7e502 | 33 | DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o |
1ac15cd8 MP |
34 | popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \ |
35 | popt/popthelp.o popt/poptparse.o | |
36 | OBJS=$(OBJS1) $(OBJS2) $(DAEMON_OBJ) $(LIBOBJ) $(ZLIBOBJ) @BUILD_POPT@ | |
c627d613 | 37 | |
77ba4cc2 | 38 | tls_OBJ = tls.o syscall.o lib/permstring.o |
7df0935a MP |
39 | |
40 | # Programs we must have to run the test cases | |
41 | CHECK_PROGS = rsync tls | |
42 | ||
366bd905 | 43 | # note that the -I. is needed to handle config.h when using VPATH |
c627d613 | 44 | .c.o: |
692da0b5 DD |
45 | @OBJ_SAVE@ |
46 | $(CC) -I. -I$(srcdir) $(CFLAGS) -c $< @CC_SHOBJ_FLAG@ | |
47 | @OBJ_RESTORE@ | |
c627d613 | 48 | |
a87b3b2a AT |
49 | all: rsync |
50 | ||
51 | man: rsync.1 rsyncd.conf.5 | |
c627d613 AT |
52 | |
53 | install: all | |
4040be4d DD |
54 | -mkdir -p ${bindir} |
55 | ${INSTALLCMD} -m 755 rsync ${bindir} | |
56 | -mkdir -p ${mandir}/man1 | |
57 | -mkdir -p ${mandir}/man5 | |
58 | ${INSTALLCMD} -m 644 $(srcdir)/rsync.1 ${mandir}/man1 | |
59 | ${INSTALLCMD} -m 644 $(srcdir)/rsyncd.conf.5 ${mandir}/man5 | |
60 | ||
61 | install-strip: | |
62 | $(MAKE) INSTALLCMD='$(INSTALLCMD) -s' install | |
c627d613 | 63 | |
95a38e86 | 64 | rsync: $(OBJS) |
76a78cd8 | 65 | @echo "Please ignore warnings below about mktemp -- it is used in a safe way" |
4ff3d9d6 MP |
66 | $(CC) $(CFLAGS) $(LDFLAGS) -o rsync $(OBJS) $(LIBS) |
67 | ||
a5ce1eb1 DD |
68 | $(OBJS): config.h |
69 | ||
7df0935a MP |
70 | tls: $(tls_OBJ) |
71 | $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(tls_OBJ) $(LIBS) | |
72 | ||
4ff3d9d6 | 73 | Makefile: Makefile.in configure config.status |
82ed9106 | 74 | echo "WARNING: You need to run ./config.status --recheck" |
4ff3d9d6 | 75 | |
f62c17e3 | 76 | # don't actually run autoconf, just issue a warning |
4ff3d9d6 | 77 | configure: configure.in |
f62c17e3 | 78 | echo "WARNING: you need to rerun autoconf" |
c627d613 | 79 | |
41059f75 | 80 | rsync.1: rsync.yo |
a87b3b2a | 81 | yodl2man -o rsync.1 rsync.yo |
41059f75 AT |
82 | |
83 | rsyncd.conf.5: rsyncd.conf.yo | |
a87b3b2a | 84 | yodl2man -o rsyncd.conf.5 rsyncd.conf.yo |
41059f75 | 85 | |
c627d613 | 86 | proto: |
3060d4aa | 87 | cat *.c lib/compat.c | awk -f mkproto.awk > proto.h |
c627d613 AT |
88 | |
89 | clean: | |
77ba4cc2 | 90 | rm -f *~ $(OBJS) rsync $(TLS_OBJ) tls |
42be5918 | 91 | rm -rf ./testtmp |
77ba4cc2 | 92 | rm -f config.cache |
c627d613 | 93 | |
af21c12f | 94 | distclean: clean |
77ba4cc2 | 95 | rm -f Makefile config.h config.status |
6e4fb64e AT |
96 | |
97 | # this target is really just for my use. It only works on a limited | |
98 | # range of machines and is used to produce a list of potentially | |
99 | # dead (ie. unused) functions in the code. (tridge) | |
100 | finddead: | |
101 | nm *.o */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt | |
102 | nm *.o */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt | |
103 | comm -13 nmused.txt nmfns.txt | |
a4772a4d MP |
104 | |
105 | # 'check' is the GNU name, 'test' is the name for everybody else :-) | |
106 | .PHONY: check test | |
107 | ||
108 | test: check | |
109 | ||
e7d29902 MP |
110 | |
111 | # There seems to be no standard way to specify some variables as | |
112 | # exported from a Makefile apart from listing them like this. | |
113 | ||
7df0935a MP |
114 | # TODO: Tests that depend on built test aide programs like tls need to |
115 | # know where the build directory is. | |
e7d29902 | 116 | |
3a4c683f MP |
117 | # This depends on building rsync; if we need any helper programs it |
118 | # should depend on them too. | |
119 | ||
42be5918 MP |
120 | # We try to run the scripts with POSIX mode on, in the hope that will |
121 | # catch Bash-isms earlier even if we're running on GNU. Of course, we | |
122 | # might lose in the future where POSIX diverges from old sh. | |
123 | ||
7df0935a | 124 | check: all $(CHECK_PROGS) |
57835c00 | 125 | POSIXLY_CORRECT=1 TLS=`pwd`/tls rsync_bin=`pwd`/rsync srcdir="$(srcdir)" $(srcdir)/runtests.sh |
e7d29902 | 126 | |
3a4c683f MP |
127 | # This does *not* depend on building or installing: you can use it to |
128 | # check a version installed from a binary or some other source tree, | |
129 | # if you want. | |
130 | ||
7df0935a | 131 | installcheck: $(CHECK_PROGS) |
57835c00 | 132 | POSIXLY_CORRECT=1 TLS=`pwd`/tls rsync_bin="$(bindir)/rsync" srcdir="$(srcdir)" $(srcdir)/runtests.sh |
e7d29902 | 133 | |
cef40af2 | 134 | # TODO: Add 'dist' target; need to know which files will be included |