Made the (re-)building of the proto.h file automatic in the
authorWayne Davison <wayned@samba.org>
Sat, 24 Nov 2007 18:54:35 +0000 (10:54 -0800)
committerWayne Davison <wayned@samba.org>
Sat, 24 Nov 2007 18:54:35 +0000 (10:54 -0800)
main Makefile rules, and the (re-)building of the man pages
automatic if yodl2man is present.

.gitignore
Makefile.in
configure
configure.in
prepare-source.mak

index abbcbef..ec67fe3 100644 (file)
@@ -10,6 +10,7 @@ config.h.in
 config.log
 config.status
 /proto.h
+/proto.h-tstamp
 /rsync.1
 /rsyncd.conf.5
 /autom4te*.cache
index c03ece4..0d4ab1e 100644 (file)
@@ -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) \
index 811a9d2..cc4bcb6 100755 (executable)
--- 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"
index 54cfd3b..9163562 100644 (file)
@@ -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)
index e7ff995..277dd6f 100644 (file)
@@ -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