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