Got rid of trailing whitespace and tweaked a few things that might
[rsync/rsync.git] / Makefile.in
1 # Makefile for rsync. This is processed by configure to produce the final
2 # Makefile
3
4 prefix=@prefix@
5 exec_prefix=@exec_prefix@
6 bindir=@bindir@
7 mandir=@mandir@
8
9 LIBS=@LIBS@
10 CC=@CC@
11 CFLAGS=@CFLAGS@
12 CPPFLAGS=@CPPFLAGS@
13 EXEEXT=@EXEEXT@
14 LDFLAGS=@LDFLAGS@
15
16 INSTALLCMD=@INSTALL@
17 INSTALLMAN=@INSTALL@
18
19 srcdir=@srcdir@
20 VPATH=$(srcdir)
21 SHELL=/bin/sh
22
23 VERSION=@VERSION@
24
25 .SUFFIXES:
26 .SUFFIXES: .c .o
27
28 LIBOBJ=lib/fnmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o \
29         lib/permstring.o @LIBOBJS@
30 ZLIBOBJ=zlib/deflate.o zlib/infblock.o zlib/infcodes.o zlib/inffast.o \
31         zlib/inflate.o zlib/inftrees.o zlib/infutil.o zlib/trees.o \
32         zlib/zutil.o zlib/adler32.o
33 OBJS1=rsync.o generator.o receiver.o cleanup.o sender.o exclude.o util.o \
34         main.o checksum.o match.o syscall.o log.o backup.o
35 OBJS2=options.o flist.o io.o compat.o hlink.o token.o uidlist.o socket.o \
36         fileio.o batch.o clientname.o
37 OBJS3=progress.o pipe.o
38 DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
39 popt_OBJS=popt/findme.o  popt/popt.o  popt/poptconfig.o \
40         popt/popthelp.o popt/poptparse.o
41 OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) $(ZLIBOBJ) @BUILD_POPT@
42
43 TLS_OBJ = tls.o syscall.o lib/permstring.o
44
45 # Programs we must have to run the test cases
46 RSYNC_EXE=rsync$(EXEEXT)
47 TLS_EXE=tls$(EXEEXT)
48 GETGROUPS_EXE=getgroups$(EXEEXT)
49 TRIMSLASH_EXE=trimslash$(EXEEXT)
50 T_UNSAFE_EXE=t_unsafe$(EXEEXT)
51 CHECK_PROGS=$(RSYNC_EXE) $(TLS_EXE) $(GETGROUPS_EXE) \
52         $(TRIMSLASH_EXE) $(T_UNSAFE_EXE)
53
54 # Objects for CHECK_PROGS to clean
55 CHECK_OBJS=getgroups.o t_stub.o t_unsafe.o trimslash.o
56
57 # note that the -I. is needed to handle config.h when using VPATH
58 .c.o:
59 @OBJ_SAVE@
60         $(CC) -I. -I$(srcdir) $(CFLAGS) $(CPPFLAGS) -c $< @CC_SHOBJ_FLAG@
61 @OBJ_RESTORE@
62
63 all: $(RSYNC_EXE)
64
65 man: rsync.1 rsyncd.conf.5
66
67 install: all
68         -mkdir -p ${DESTDIR}${bindir}
69         ${INSTALLCMD} ${STRIP} -m 755 $(RSYNC_EXE) ${DESTDIR}${bindir}
70         -mkdir -p ${DESTDIR}${mandir}/man1
71         -mkdir -p ${DESTDIR}${mandir}/man5
72         ${INSTALLMAN} -m 644 $(srcdir)/rsync.1 ${DESTDIR}${mandir}/man1
73         ${INSTALLMAN} -m 644 $(srcdir)/rsyncd.conf.5 ${DESTDIR}${mandir}/man5
74
75 install-strip:
76         $(MAKE) STRIP='-s' install
77
78 $(RSYNC_EXE): $(OBJS)
79         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
80
81 $(OBJS): config.h
82
83 $(TLS_EXE): $(TLS_OBJ)
84         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TLS_OBJ) $(LIBS)
85
86 $(GETGROUPS_EXE): getgroups.o
87         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getgroups.o $(LIBS)
88
89 TRIMSLASH_OBJ = trimslash.o syscall.o
90 $(TRIMSLASH_EXE): $(TRIMSLASH_OBJ)
91         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TRIMSLASH_OBJ) $(LIBS)
92
93 T_UNSAFE_OBJ = t_unsafe.o syscall.o util.o t_stub.o lib/compat.o lib/snprintf.o
94 $(T_UNSAFE_EXE): $(T_UNSAFE_OBJ)
95         $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(T_UNSAFE_OBJ) $(LIBS)
96
97 # I don't like these rules because CVS can skew the timestamps and
98 # produce spurious warnings, and also make "make install" fail if the
99 # source directory can no longer be found.  Since we don't rebuild
100 # automatically they're kind of lame anyhow.
101
102 #Makefile: Makefile.in configure config.status
103 #       echo "WARNING: You need to run ./config.status --recheck"
104
105 # don't actually run autoconf, just issue a warning
106 #configure: configure.in
107 #       echo "WARNING: you need to rerun autoconf"
108
109 $(srcdir)/rsync.1: $(srcdir)/rsync.yo
110         yodl2man -o $(srcdir)/rsync.1 $(srcdir)/rsync.yo
111
112 $(srcdir)/rsyncd.conf.5: $(srcdir)/rsyncd.conf.yo
113         yodl2man -o $(srcdir)/rsyncd.conf.5 $(srcdir)/rsyncd.conf.yo
114
115 proto:
116         cat $(srcdir)/*.c $(srcdir)/lib/compat.c | awk -f $(srcdir)/mkproto.awk > $(srcdir)/proto.h
117
118 clean: cleantests
119         rm -f *~ $(OBJS) $(TLS_OBJ) $(CHECK_PROGS) $(CHECK_OBJS)
120
121 cleantests:
122         rm -rf ./testtmp*
123
124 # We try to delete built files from both the source and build
125 # directories, just in case somebody previously configured things in
126 # the source directory.
127 distclean: clean
128         rm -f Makefile config.h config.status
129         rm -f $(srcdir)/Makefile $(srcdir)/config.h $(srcdir)/config.status
130
131         rm -f config.cache config.log
132         rm -f $(srcdir)/config.cache $(srcdir)/config.log
133
134         rm -f shconfig $(srcdir)/shconfig
135
136 # this target is really just for my use. It only works on a limited
137 # range of machines and is used to produce a list of potentially
138 # dead (ie. unused) functions in the code. (tridge)
139 finddead:
140         nm *.o */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt
141         nm *.o */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt
142         comm -13 nmused.txt nmfns.txt
143
144 # 'check' is the GNU name, 'test' is the name for everybody else :-)
145 .PHONY: check test
146
147 test: check
148
149
150 # There seems to be no standard way to specify some variables as
151 # exported from a Makefile apart from listing them like this.
152
153 # TODO: Tests that depend on built test aide programs like tls need to
154 # know where the build directory is.
155
156 # This depends on building rsync; if we need any helper programs it
157 # should depend on them too.
158
159 # We try to run the scripts with POSIX mode on, in the hope that will
160 # catch Bash-isms earlier even if we're running on GNU.  Of course, we
161 # might lose in the future where POSIX diverges from old sh.
162
163 check: all $(CHECK_PROGS)
164         POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin=`pwd`/$(RSYNC_EXE) srcdir="$(srcdir)" $(srcdir)/runtests.sh
165
166 # This does *not* depend on building or installing: you can use it to
167 # check a version installed from a binary or some other source tree,
168 # if you want.
169
170 installcheck: $(CHECK_PROGS)
171         POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin="$(bindir)/$(RSYNC_EXE)" srcdir="$(srcdir)" $(srcdir)/runtests.sh
172
173 # TODO: Add 'dist' target; need to know which files will be included
174
175 # Run the SPLINT (Secure Programming Lint) tool.  <www.splint.org>
176 .PHONY: splint
177 splint:
178         splint +unixlib +gnuextensions -weak rsync.c
179
180
181 rsync.dvi: doc/rsync.texinfo
182         texi2dvi -o $@ $<
183
184 rsync.ps: rsync.dvi
185         dvips -ta4 -o $@ $<
186
187 rsync.pdf: doc/rsync.texinfo
188         texi2dvi -o $@ --pdf $<
189
190
191 doxygen:
192         cd $(srcdir) && rm dox/html/* && doxygen
193
194 # for maintainers only
195 doxygen-upload:
196         rsync -avzv $(srcdir)/dox/html/ --delete \
197         samba.org:/home/httpd/html/rsync/doxygen/head/