]> git.sur5r.net Git - groeck-it87/commitdiff
Makefile: Generate version.h
authorGuenter Roeck <linux@roeck-us.net>
Sun, 24 Sep 2017 11:13:05 +0000 (04:13 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 24 Sep 2017 11:15:20 +0000 (04:15 -0700)
Update version after each change in it87.c.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Makefile

index 8481a0a00374fd14b913ef6c353da18ccc63ccda..2064147b6a708dd47ba496b57bfbe43b56d46a3b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -44,7 +44,12 @@ all: modules
 
 # Targets for running make directly in the external module directory:
 
-modules clean:
+DRIVER_VERSION = $(shell git describe --long)
+
+version.h: it87.c
+       @echo "#define IT87_DRIVER_VERSION      \"$(DRIVER_VERSION)\"" > version.h
+
+modules clean: version.h
        @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) $@
 
 install: modules_install