From 225787a4a4c3ed08dade67d057a4a858f6273a10 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sat, 24 Nov 2007 10:54:35 -0800 Subject: [PATCH] Made the (re-)building of the proto.h file automatic in the main Makefile rules, and the (re-)building of the man pages automatic if yodl2man is present. --- .gitignore | 1 + Makefile.in | 28 +++++++++++++++++++++------- configure | 3 +-- configure.in | 6 ++++++ prepare-source.mak | 15 --------------- 5 files changed, 29 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index abbcbef2..ec67fe33 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ config.h.in config.log config.status /proto.h +/proto.h-tstamp /rsync.1 /rsyncd.conf.5 /autom4te*.cache diff --git a/Makefile.in b/Makefile.in index c03ece48..0d4ab1e2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -59,7 +59,7 @@ CHECK_OBJS=getgroups.o getfsdev.o t_stub.o t_unsafe.o trimslash.o wildtest.o $(CC) -I. -I$(srcdir) $(CFLAGS) $(CPPFLAGS) -c $< @CC_SHOBJ_FLAG@ @OBJ_RESTORE@ -all: rsync$(EXEEXT) +all: rsync$(EXEEXT) @MAKE_MAN@ install: all -mkdir -p ${DESTDIR}${bindir} @@ -104,17 +104,31 @@ T_UNSAFE_OBJ = t_unsafe.o syscall.o util.o t_stub.o lib/compat.o lib/snprintf.o t_unsafe$(EXEEXT): $(T_UNSAFE_OBJ) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(T_UNSAFE_OBJ) $(LIBS) -gen: - cd $(srcdir) && $(MAKE) -f prepare-source.mak gen +gen: conf proto.h man + +conf: + cd $(srcdir) && $(MAKE) -f prepare-source.mak conf gensend: gen rsync -aivzc $(GENFILES) samba.org:/home/ftp/pub/rsync/generated-files/ -man: - cd $(srcdir) && $(MAKE) -f prepare-source.mak man +proto: proto.h-tstamp + +proto.h: proto.h-tstamp + +proto.h-tstamp: *.c lib/compat.c + perl mkproto.pl *.c lib/compat.c + touch proto.h-tstamp + +man: rsync.1 rsyncd.conf.5 + +rsync.1: rsync.yo + yodl2man -o rsync.1 rsync.yo + -./tweak_manpage rsync.1 -proto: - cd $(srcdir) && $(MAKE) -f prepare-source.mak proto.h +rsyncd.conf.5: rsyncd.conf.yo + yodl2man -o rsyncd.conf.5 rsyncd.conf.yo + -./tweak_manpage rsyncd.conf.5 clean: cleantests rm -f *~ $(OBJS) $(TLS_OBJ) $(CHECK_PROGS) $(CHECK_OBJS) $(CHECK_SYMLINKS) \ diff --git a/configure b/configure index 811a9d2f..cc4bcb63 100755 --- a/configure +++ b/configure @@ -13,12 +13,11 @@ if [ ! -f "$realconfigure" ]; then else curdir='' fi - make -f prepare-source.mak proto.h if make -f prepare-source.mak conf; then : elif [ -f "$HOME/build_farm/build_test.fns" ]; then # Allow the build farm to grab latest files via rsync. - rsync -avz rsync://rsync.samba.org/rsyncftp/generated-files/'c*' . + rsync -pvz rsync://rsync.samba.org/rsyncftp/generated-files/'c*' . else echo 'Failed to build configure.sh and/or config.h.in -- giving up.' >&2 rm -f "$realconfigure" diff --git a/configure.in b/configure.in index 54cfd3b1..91635626 100644 --- a/configure.in +++ b/configure.in @@ -123,6 +123,11 @@ else fi AC_DEFINE_UNQUOTED(RSYNC_RSH, "$RSYNC_RSH", [default -e command]) +AC_CHECK_PROG(HAVE_YODL2MAN, yodl2man, 1, 0) +if test x$HAVE_YODL2MAN = x1; then + MAKE_MAN=man +fi + AC_ARG_WITH(nobody-group, AC_HELP_STRING([--with-nobody-group=GROUP], [set the default unprivileged group (default nobody or nogroup)]), @@ -813,6 +818,7 @@ AC_SUBST(OBJ_SAVE) AC_SUBST(OBJ_RESTORE) AC_SUBST(CC_SHOBJ_FLAG) AC_SUBST(BUILD_POPT) +AC_SUBST(MAKE_MAN) AC_CHECK_HEADERS(sys/acl.h acl/libacl.h) AC_CHECK_FUNCS(_acl __acl _facl __facl) diff --git a/prepare-source.mak b/prepare-source.mak index e7ff9958..277dd6f2 100644 --- a/prepare-source.mak +++ b/prepare-source.mak @@ -1,5 +1,3 @@ -gen: conf proto.h man - conf: configure.sh config.h.in configure.sh: configure.in aclocal.m4 @@ -7,16 +5,3 @@ configure.sh: configure.in aclocal.m4 config.h.in: configure.in aclocal.m4 autoheader && touch config.h.in - -proto.h: *.c lib/compat.c - perl mkproto.pl *.c lib/compat.c - -man: rsync.1 rsyncd.conf.5 - -rsync.1: rsync.yo - yodl2man -o rsync.1 rsync.yo - -./tweak_manpage rsync.1 - -rsyncd.conf.5: rsyncd.conf.yo - yodl2man -o rsyncd.conf.5 rsyncd.conf.yo - -./tweak_manpage rsyncd.conf.5 -- 2.34.1