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