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