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