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