From 5e4d82b615d01f5c6e7a3b21746772059aa19c8c Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Sun, 1 Oct 2017 19:11:33 -0700 Subject: [PATCH] Drop version.h Some distributions use their own Makefile and thus won't create version.h, resulting in a build failure. Pass the version as define instead. That won't help for generating the driver version with those distributions, but at least the driver will build. Signed-off-by: Guenter Roeck --- .gitignore | 1 - Makefile | 10 +++------- it87.c | 5 ++++- 3 files changed, 7 insertions(+), 9 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 6702033..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -version.h diff --git a/Makefile b/Makefile index e702b2c..d4b96c3 100644 --- a/Makefile +++ b/Makefile @@ -44,17 +44,13 @@ all: modules # Targets for running make directly in the external module directory: -DRIVER_VERSION = $(shell git describe --long) +EXTRA_CFLAGS=-DIT87_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) $@ +modules: + @$(MAKE) EXTRA_CFLAGS=$(EXTRA_CFLAGS) -C $(KERNEL_BUILD) M=$(CURDIR) $@ clean: @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) $@ - rm -f version.h install: modules_install diff --git a/it87.c b/it87.c index acbc1ff..fc9ee80 100644 --- a/it87.c +++ b/it87.c @@ -74,7 +74,10 @@ #include #include #include "compat.h" -#include "version.h" + +#ifndef IT87_DRIVER_VERSION +#define IT87_DRIVER_VERSION "" +#endif #define DRVNAME "it87" -- 2.39.5