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