Added SVN revision to distribution.
authorFlorian Pose <fp@igh-essen.com>
Mon, 25 Sep 2006 12:11:05 +0000
changeset 366 148ac5ef18ae
parent 365 7aede8ed6025
child 367 e85e3143dc8d
Added SVN revision to distribution.
Makefile.am
devices/Kbuild
master/Kbuild
--- a/Makefile.am	Mon Sep 25 11:12:50 2006 +0000
+++ b/Makefile.am	Mon Sep 25 12:11:05 2006 +0000
@@ -68,6 +68,11 @@
 
 EXTRA_DIST = $(noinst_SCRIPTS) $(MINI_FILES) $(RTAI_FILES) $(MSR_FILES)
 
+dist-hook:
+	if which svnversion >/dev/null 2>&1; then \
+		svnversion $(srcdir) 2>/dev/null >$(distdir)/svnrevision; \
+	fi
+
 install-data-local:
 	$(mkinstalldirs) $(bindir)
 	$(mkinstalldirs) $(initdir)
--- a/devices/Kbuild	Mon Sep 25 11:12:50 2006 +0000
+++ b/devices/Kbuild	Mon Sep 25 12:11:05 2006 +0000
@@ -39,7 +39,11 @@
 
 ec_8139too-objs := 8139too.o
 
-REV := $(shell svnversion $(src) 2>/dev/null || echo "unknown")
+REV := $(shell if test -s $(src)/../svnrevision; then \
+		cat $(src)/../svnrevision; \
+	else \
+		svnversion $(src) 2>/dev/null || echo "unknown"; \
+	fi)
 
 EXTRA_CFLAGS = -DEC_REV=$(REV) -DEC_USER=$(USER)
 
--- a/master/Kbuild	Mon Sep 25 11:12:50 2006 +0000
+++ b/master/Kbuild	Mon Sep 25 12:11:05 2006 +0000
@@ -40,7 +40,11 @@
 ec_master-objs := module.o master.o device.o slave.o datagram.o \
 		domain.o mailbox.o ethernet.o debug.o fsm.o xmldev.o
 
-REV := $(shell svnversion $(src) 2>/dev/null || echo "unknown")
+REV := $(shell if test -s $(src)/../svnrevision; then \
+		cat $(src)/../svnrevision; \
+	else \
+		svnversion $(src) 2>/dev/null || echo "unknown"; \
+	fi)
 
 EXTRA_CFLAGS := -DSVNREV=$(REV) -DUSER=$(USER)