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