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