From e7caee4aaf12aff79a2cd119b47464016cd765ba Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Sun, 24 Sep 2017 04:13:05 -0700 Subject: [PATCH] Makefile: Generate version.h Update version after each change in it87.c. Signed-off-by: Guenter Roeck --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8481a0a..2064147 100644 --- 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 -- 2.39.2