changeset 173:03ab3ade9fe5

modify display version.
author Naoya OYAMA <naoya.oyama@gmail.com>
date Mon, 29 Oct 2012 23:34:49 +0900
parents 89e24a1c8a64
children 986842a5a569
files src/Makefile src/recpt1.c src/version.h
diffstat 3 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/Makefile	Mon Oct 29 22:25:59 2012 +0900
+++ b/src/Makefile	Mon Oct 29 23:34:49 2012 +0900
@@ -100,11 +100,19 @@
 	$(CC) $(OBJS3) $(LDFLAGS) $(EXTRALIBS) -o $@
 
 clean:
-	-$(RM) -f *.o $(PROG) $(PROG2) $(PROG3) $(PROG4)
+	-$(RM) -f *.o $(PROG) $(PROG2) $(PROG3) $(PROG4) version.h
 	-$(RM) -f .depend
 
 distclean:
 
+version.h:
+	revh=`hg parents --template 'const char *version = "r{rev}:{node|short} ({date|shortdate})";\n' 2>/dev/null`; \
+	if [ -n "$$revh" ] ; then \
+		echo "$$revh" > $@; \
+	else \
+		echo "const char *version = \"$(RELEASE_VERSION)\";" > $@; \
+	fi
+
 install: $(PROG) $(PROG2) $(PROG3) $(PROG4)
 	$(INSTALL) -d $(bindir)
 	$(INSTALL) $(PROG) $(bindir)
@@ -118,7 +126,7 @@
 	$(STRIP) $(INSTALLSTRIP) $(bindir)/$(PROG3)
 	$(STRIP) $(INSTALLSTRIP) $(bindir)/$(PROG4)
 
-depend:
+depend: version.h
 	$(CC) -I.. -MM $(CFLAGS) $(SRCS) 1>.depend
 
 .PHONY: clean distclean install depend
--- a/src/recpt1.c	Mon Oct 29 22:25:59 2012 +0900
+++ b/src/recpt1.c	Mon Oct 29 23:34:49 2012 +0900
@@ -1134,7 +1134,7 @@
             break;
         case 'v':
             fprintf(stderr, "%s %s\n", argv[0], version);
-            fprintf(stderr, "recorder command for PT1/2 digital tuner.\n");
+            fprintf(stderr, "recorder command for PT1/2/3 digital tuner.\n");
             exit(0);
             break;
         case 'l':
--- a/src/version.h	Mon Oct 29 22:25:59 2012 +0900
+++ b/src/version.h	Mon Oct 29 23:34:49 2012 +0900
@@ -1,1 +1,1 @@
-const char *version = "r100:aeba1988234f (2010-02-13)";
+const char *version = "r172:89e24a1c8a64 (2012-10-29)";