/rsync
/stunnel-rsyncd.conf
/shconfig
+/git-version.h
/testdir
/tests-dont-exist
/testtmp
$(OBJS): $(HEADERS)
$(CHECK_OBJS): $(HEADERS)
tls.o xattrs.o: lib/sysxattrs.h
-options.o: latest-year.h help-rsync.h help-rsyncd.h
+options.o: latest-year.h help-rsync.h help-rsyncd.h git-version.h
exclude.o: default-cvsignore.h
loadparm.o: default-dont-compress.h daemon-parm.h
fi
@rm -f rounding.out
+# While $(wildcard ...) is a GNU make idiom, at least other makes should just turn it into an
+# empty string (we need something that will vanish if we're not building a git checkout).
+# If you want an updated git version w/o GNU make, remove git-version.h after a pull.
+git-version.h: mkgitver $(wildcard $(srcdir)/.git/logs/HEAD)
+ $(srcdir)/mkgitver
+
simd-checksum-x86_64.o: simd-checksum-x86_64.cpp
@$(srcdir)/cmdormsg disable-simd $(CXX) -I. $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $(srcdir)/simd-checksum-x86_64.cpp
--- /dev/null
+#!/bin/sh
+
+srcdir=`dirname $0`
+
+if test -d "$srcdir/.git"; then
+ gitver=\"`git describe --tags`\" || exit 1
+else
+ gitver=RSYNC_VERSION
+fi
+echo "#define RSYNC_GITVER $gitver" >git-version.h
#include "itypes.h"
#include "ifuncs.h"
#include "latest-year.h"
+#include "git-version.h"
#include <popt.h>
extern int module_id;
subprotocol = istring(".PR%d", SUBPROTOCOL_VERSION);
#endif
rprintf(f, "%s version %s protocol version %d%s\n",
- RSYNC_NAME, RSYNC_VERSION, PROTOCOL_VERSION, subprotocol);
+ RSYNC_NAME, RSYNC_GITVER, PROTOCOL_VERSION, subprotocol);
rprintf(f, "Copyright (C) 1996-" LATEST_YEAR " by Andrew Tridgell, Wayne Davison, and others.\n");
rprintf(f, "Web site: https://rsync.samba.org/\n");