Split up the ifuncs.h file into 3 .h files.
[rsync/rsync.git] / Makefile.in
... / ...
CommitLineData
1# Makefile for rsync. This is processed by configure to produce the final
2# Makefile
3
4prefix=@prefix@
5datarootdir=@datarootdir@
6exec_prefix=@exec_prefix@
7bindir=@bindir@
8mandir=@mandir@
9
10LIBS=@LIBS@
11CC=@CC@
12CFLAGS=@CFLAGS@
13CPPFLAGS=@CPPFLAGS@
14EXEEXT=@EXEEXT@
15LDFLAGS=@LDFLAGS@
16
17INSTALLCMD=@INSTALL@
18INSTALLMAN=@INSTALL@
19
20srcdir=@srcdir@
21VPATH=$(srcdir)
22SHELL=/bin/sh
23
24VERSION=@VERSION@
25
26.SUFFIXES:
27.SUFFIXES: .c .o
28
29GENFILES=configure.sh config.h.in proto.h proto.h-tstamp rsync.1 rsyncd.conf.5
30HEADERS=byteorder.h config.h errcode.h proto.h rsync.h ifuncs.h itypes.h inums.h \
31 lib/pool_alloc.h
32LIBOBJ=lib/wildmatch.o lib/compat.o lib/snprintf.o lib/mdfour.o lib/md5.o \
33 lib/permstring.o lib/pool_alloc.o lib/sysacls.o lib/sysxattrs.o @LIBOBJS@
34ZLIBOBJ=zlib/deflate.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o \
35 zlib/trees.o zlib/zutil.o zlib/adler32.o zlib/compress.o zlib/crc32.o
36OBJS1=flist.o rsync.o generator.o receiver.o cleanup.o sender.o exclude.o \
37 util.o main.o checksum.o match.o syscall.o log.o backup.o
38OBJS2=options.o io.o compat.o hlink.o token.o uidlist.o socket.o hashtable.o \
39 fileio.o batch.o clientname.o chmod.o acls.o xattrs.o
40OBJS3=progress.o pipe.o
41DAEMON_OBJ = params.o loadparm.o clientserver.o access.o connection.o authenticate.o
42popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
43 popt/popthelp.o popt/poptparse.o
44OBJS=$(OBJS1) $(OBJS2) $(OBJS3) $(DAEMON_OBJ) $(LIBOBJ) $(ZLIBOBJ) @BUILD_POPT@
45
46TLS_OBJ = tls.o syscall.o lib/compat.o lib/snprintf.o lib/permstring.o lib/sysxattrs.o @BUILD_POPT@
47
48# Programs we must have to run the test cases
49CHECK_PROGS = rsync$(EXEEXT) tls$(EXEEXT) getgroups$(EXEEXT) getfsdev$(EXEEXT) \
50 trimslash$(EXEEXT) t_unsafe$(EXEEXT) wildtest$(EXEEXT)
51
52CHECK_SYMLINKS = testsuite/chown-fake.test testsuite/devices-fake.test
53
54# Objects for CHECK_PROGS to clean
55CHECK_OBJS=tls.o getgroups.o getfsdev.o t_stub.o t_unsafe.o trimslash.o wildtest.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
63all: conf_stop make_stop rsync$(EXEEXT) @MAKE_MAN@
64
65install: all
66 -mkdir -p ${DESTDIR}${bindir}
67 ${INSTALLCMD} ${INSTALL_STRIP} -m 755 rsync$(EXEEXT) ${DESTDIR}${bindir}
68 -mkdir -p ${DESTDIR}${mandir}/man1
69 -mkdir -p ${DESTDIR}${mandir}/man5
70 if test -f rsync.1; then ${INSTALLMAN} -m 644 rsync.1 ${DESTDIR}${mandir}/man1; fi
71 if test -f rsyncd.conf.5; then ${INSTALLMAN} -m 644 rsyncd.conf.5 ${DESTDIR}${mandir}/man5; fi
72
73install-strip:
74 $(MAKE) INSTALL_STRIP='-s' install
75
76rsync$(EXEEXT): $(OBJS)
77 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
78
79$(OBJS): $(HEADERS)
80$(CHECK_OBJS): $(HEADERS)
81
82flist.o: rounding.h
83
84rounding.h: rounding.c rsync.h
85 @for r in 0 1 3; do \
86 if $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o rounding -DEXTRA_ROUNDING=$$r -I. $(srcdir)/rounding.c >rounding.out 2>&1; then \
87 echo "#define EXTRA_ROUNDING $$r" >rounding.h; \
88 if test -f "$$HOME/build_farm/build_test.fns"; then \
89 echo "EXTRA_ROUNDING is $$r" >&2; \
90 fi; \
91 break; \
92 fi; \
93 done
94 @rm -f rounding
95 @if test -f rounding.h; then : ; else \
96 cat rounding.out 1>&2; \
97 echo "Failed to create rounding.h!" 1>&2; \
98 exit 1; \
99 fi
100 @rm -f rounding.out
101
102tls$(EXEEXT): $(TLS_OBJ)
103 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TLS_OBJ) $(LIBS)
104
105getgroups$(EXEEXT): getgroups.o
106 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getgroups.o $(LIBS)
107
108getfsdev$(EXEEXT): getfsdev.o
109 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ getfsdev.o $(LIBS)
110
111TRIMSLASH_OBJ = trimslash.o syscall.o lib/compat.o lib/snprintf.o
112trimslash$(EXEEXT): $(TRIMSLASH_OBJ)
113 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TRIMSLASH_OBJ) $(LIBS)
114
115T_UNSAFE_OBJ = t_unsafe.o syscall.o util.o t_stub.o lib/compat.o lib/snprintf.o lib/wildmatch.o
116t_unsafe$(EXEEXT): $(T_UNSAFE_OBJ)
117 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(T_UNSAFE_OBJ) $(LIBS)
118
119gen: conf proto.h man
120
121gensend: gen
122 rsync -aivzc $(GENFILES) samba.org:/home/ftp/pub/rsync/generated-files/
123
124conf:
125 cd $(srcdir) && $(MAKE) -f prepare-source.mak conf
126
127conf_stop: configure.sh config.h.in
128
129configure.sh config.h.in: configure.in aclocal.m4
130 @if test -f configure.sh; then cp -p configure.sh configure.sh.old; else touch configure.sh.old; fi
131 @if test -f config.h.in; then cp -p config.h.in config.h.in.old; else touch config.h.in.old; fi
132 autoconf -o configure.sh
133 autoheader && touch config.h.in
134 @if diff configure.sh configure.sh.old >/dev/null 2>&1; then \
135 echo "configure.sh is unchanged."; \
136 rm configure.sh.old; \
137 fi
138 @if diff config.h.in config.h.in.old >/dev/null 2>&1; then \
139 echo "config.h.in is unchanged."; \
140 rm config.h.in.old; \
141 fi
142 @if test -f configure.sh.old -o -f config.h.in.old; then \
143 echo 'Configure files changed -- perhaps run:'; \
144 echo ' make reconfigure'; \
145 exit 1; \
146 fi
147
148reconfigure: configure.sh
149 ./config.status --recheck
150 ./config.status
151
152make_stop: Makefile
153
154Makefile: Makefile.in config.status
155 @if test -f Makefile; then cp -p Makefile Makefile.old; else touch Makefile.old; fi
156 @./config.status
157 @if diff Makefile Makefile.old >/dev/null 2>&1; then \
158 echo "Makefile is unchanged."; \
159 rm Makefile.old; \
160 else \
161 echo "Makefile updated -- rerun your make command."; \
162 exit 1; \
163 fi
164
165proto: proto.h-tstamp
166
167proto.h: proto.h-tstamp
168 @if test -f proto.h; then :; else cp -p $(srcdir)/proto.h .; fi
169
170proto.h-tstamp: $(srcdir)/*.c $(srcdir)/lib/compat.c
171 perl $(srcdir)/mkproto.pl $(srcdir)/*.c $(srcdir)/lib/compat.c
172
173man: rsync.1 rsyncd.conf.5
174 @if test -f rsync.1; then :; else cp -p $(srcdir)/rsync.1 .; fi
175 @if test -f rsyncd.conf.5; then :; else cp -p $(srcdir)/rsyncd.conf.5 .; fi
176
177rsync.1: rsync.yo
178 yodl2man -o rsync.1 $(srcdir)/rsync.yo
179 -$(srcdir)/tweak_manpage rsync.1
180
181rsyncd.conf.5: rsyncd.conf.yo
182 yodl2man -o rsyncd.conf.5 $(srcdir)/rsyncd.conf.yo
183 -$(srcdir)/tweak_manpage rsyncd.conf.5
184
185clean: cleantests
186 rm -f *~ $(OBJS) $(CHECK_PROGS) $(CHECK_OBJS) $(CHECK_SYMLINKS) \
187 rounding rounding.h *.old
188
189cleantests:
190 rm -rf ./testtmp*
191
192# We try to delete built files from both the source and build
193# directories, just in case somebody previously configured things in
194# the source directory.
195distclean: clean
196 rm -f Makefile config.h config.status
197 rm -f lib/dummy popt/dummy zlib/dummy
198 rm -f $(srcdir)/Makefile $(srcdir)/config.h $(srcdir)/config.status
199 rm -f $(srcdir)/lib/dummy $(srcdir)/popt/dummy $(srcdir)/zlib/dummy
200 rm -f config.cache config.log
201 rm -f $(srcdir)/config.cache $(srcdir)/config.log
202 rm -f shconfig $(srcdir)/shconfig
203 rm -f $(GENFILES)
204 rm -rf autom4te.cache
205
206# this target is really just for my use. It only works on a limited
207# range of machines and is used to produce a list of potentially
208# dead (ie. unused) functions in the code. (tridge)
209finddead:
210 nm *.o */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt
211 nm *.o */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt
212 comm -13 nmused.txt nmfns.txt
213
214# 'check' is the GNU name, 'test' is the name for everybody else :-)
215.PHONY: check test
216
217test: check
218
219# There seems to be no standard way to specify some variables as
220# exported from a Makefile apart from listing them like this.
221
222# This depends on building rsync; if we need any helper programs it
223# should depend on them too.
224
225# We try to run the scripts with POSIX mode on, in the hope that will
226# catch Bash-isms earlier even if we're running on GNU. Of course, we
227# might lose in the future where POSIX diverges from old sh.
228
229check: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
230 rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh
231
232check29: all $(CHECK_PROGS) $(CHECK_SYMLINKS)
233 rsync_bin=`pwd`/rsync$(EXEEXT) $(srcdir)/runtests.sh --protocol=29
234
235wildtest.o: wildtest.c lib/wildmatch.c rsync.h config.h
236wildtest$(EXEEXT): wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@
237 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ wildtest.o lib/compat.o lib/snprintf.o @BUILD_POPT@ $(LIBS)
238
239testsuite/chown-fake.test:
240 ln -s chown.test $(srcdir)/testsuite/chown-fake.test
241
242testsuite/devices-fake.test:
243 ln -s devices.test $(srcdir)/testsuite/devices-fake.test
244
245# This does *not* depend on building or installing: you can use it to
246# check a version installed from a binary or some other source tree,
247# if you want.
248
249installcheck: $(CHECK_PROGS) $(CHECK_SYMLINKS)
250 POSIXLY_CORRECT=1 TOOLDIR=`pwd` rsync_bin="$(bindir)/rsync$(EXEEXT)" srcdir="$(srcdir)" $(srcdir)/runtests.sh
251
252# TODO: Add 'dist' target; need to know which files will be included
253
254# Run the SPLINT (Secure Programming Lint) tool. <www.splint.org>
255.PHONY: splint
256splint:
257 splint +unixlib +gnuextensions -weak rsync.c
258
259
260rsync.dvi: doc/rsync.texinfo
261 texi2dvi -o $@ $<
262
263rsync.ps: rsync.dvi
264 dvips -ta4 -o $@ $<
265
266rsync.pdf: doc/rsync.texinfo
267 texi2dvi -o $@ --pdf $<
268
269
270doxygen:
271 cd $(srcdir) && rm dox/html/* && doxygen
272
273# for maintainers only
274doxygen-upload:
275 rsync -avzv $(srcdir)/dox/html/ --delete \
276 samba.org:/home/httpd/html/rsync/doxygen/head/