]> git.sur5r.net Git - groeck-it87/blobdiff - Makefile
README: Fix typo
[groeck-it87] / Makefile
index 2064147b6a708dd47ba496b57bfbe43b56d46a3b..1b88e2a01ce096f7a5e697b9cc51f297ac5c0150 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -44,12 +44,16 @@ all: modules
 
 # Targets for running make directly in the external module directory:
 
-DRIVER_VERSION = $(shell git describe --long)
+ifneq ("","$(wildcard .git/*)")
+IT87_CFLAGS=-DIT87_DRIVER_VERSION='\"$(shell git describe --long)\"'
+else
+IT87_CFLAGS=-DIT87_DRIVER_VERSION='\"<unknown>\"'
+endif
 
-version.h: it87.c
-       @echo "#define IT87_DRIVER_VERSION      \"$(DRIVER_VERSION)\"" > version.h
+modules:
+       @$(MAKE) EXTRA_CFLAGS="$(IT87_CFLAGS)" -C $(KERNEL_BUILD) M=$(CURDIR) $@
 
-modules clean: version.h
+clean:
        @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) $@
 
 install: modules_install