]> git.sur5r.net Git - groeck-it87/blobdiff - Makefile
Remove version.h when running clean, and clean does not depend on version.h
[groeck-it87] / Makefile
index 8481a0a00374fd14b913ef6c353da18ccc63ccda..e702b2c6e61c2e452abb982a82c56af049b30e4c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -44,8 +44,17 @@ 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: version.h
+       @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) $@
+
+clean:
        @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) $@
+       rm -f version.h
 
 install: modules_install