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