# Targets for running make directly in the external module directory:
-DRIVER_VERSION = $(shell git describe --long)
-
-version.h: it87.c
- @echo "#define IT87_DRIVER_VERSION \"$(DRIVER_VERSION)\"" > version.h
+ifneq ("","$(wildcard .git/*)")
+IT87_CFLAGS=-DIT87_DRIVER_VERSION='\"$(shell git describe --long)\"'
+else
+IT87_CFLAGS=-DIT87_DRIVER_VERSION='\"<unknown>\"'
+endif
-modules: version.h
- @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) $@
+modules:
+ @$(MAKE) EXTRA_CFLAGS="$(IT87_CFLAGS)" -C $(KERNEL_BUILD) M=$(CURDIR) $@
clean:
@$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) $@
- rm -f version.h
install: modules_install