Mercurial > pt1.mumumu
changeset 90:c6311b6efd9c
- version string should be generated upon revision on mercurial repository
- version bump to 1.1.0 on other environment
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Wed, 27 Jan 2010 16:43:03 +0900 |
parents | d74bcf2d255d |
children | 2b55985bbb4c |
files | driver/Makefile driver/pt1_pci.c |
diffstat | 2 files changed, 17 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/driver/Makefile Wed Jan 27 15:12:50 2010 +0900 +++ b/driver/Makefile Wed Jan 27 16:43:03 2010 +0900 @@ -1,9 +1,11 @@ -TARGET:= pt1_drv.ko +TARGET := pt1_drv.ko VERBOSITY = 0 +REL_VERSION = "1.1.0" +REL_DATE = "2010-01-27" all: ${TARGET} -pt1_drv.ko: pt1_pci.c pt1_i2c.c pt1_tuner.c pt1_tuner_data.c +pt1_drv.ko: pt1_pci.c pt1_i2c.c pt1_tuner.c pt1_tuner_data.c version.h make -C /lib/modules/`uname -r`/build M=`pwd` V=$(VERBOSITY) modules clean: @@ -13,7 +15,15 @@ pt1_drv-objs := pt1_pci.o pt1_i2c.o pt1_tuner.o pt1_tuner_data.o -clean-files := *.o *.ko *.mod.[co] *~ +clean-files := *.o *.ko *.mod.[co] *~ version.h + +version.h: + revh=`hg parents --template '#define DRV_VERSION "r{rev}:{node|short}"\n#define DRV_RELDATE "{date|shortdate}"\n' 2>/dev/null`; \ + if [ -n "$$revh" ] ; then \ + echo "$$revh" > $@; \ + else \ + printf "#define DRV_VERSION \"$(REL_VERSION)\"\n#define DRV_RELDATE \"$(REL_DATE)\"\n" > $@; \ + fi install: $(TARGET) install -m 644 $(TARGET) /lib/modules/`uname -r`/kernel/drivers/video
--- a/driver/pt1_pci.c Wed Jan 27 15:12:50 2010 +0900 +++ b/driver/pt1_pci.c Wed Jan 27 16:43:03 2010 +0900 @@ -1,8 +1,6 @@ /* pt1-pci.c: A PT1 on PCI bus driver for Linux. */ #define DRV_NAME "pt1-pci" -#define DRV_VERSION "1.00" -#define DRV_RELDATE "11/28/2008" - +#include "version.h" #include <linux/module.h> #include <linux/kernel.h> @@ -44,10 +42,10 @@ /* These identify the driver base version and may not be removed. */ static char version[] __devinitdata = -KERN_INFO DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " \n"; +KERN_INFO DRV_NAME ".c: " DRV_VERSION " " DRV_RELDATE " \n"; -MODULE_AUTHOR("Tomoaki Ishikawa tomy@users.sourceforge.jp"); -#define DRIVER_DESC "PCI earthsoft PT1 driver" +MODULE_AUTHOR("Tomoaki Ishikawa tomy@users.sourceforge.jp and Yoshiki Yazawa yaz@honeyplanet.jp"); +#define DRIVER_DESC "PCI earthsoft PT1/2 driver" MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL");