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