diff options
Diffstat (limited to 'src/Makefile')
-rw-r--r-- | src/Makefile | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/src/Makefile b/src/Makefile index 9899a73..c20bfd3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -19,32 +19,19 @@ ifneq ($(V),1) MAKEFLAGS += --no-print-directory endif -version.h: - @export GIT_CEILING_DIRECTORIES="$$(readlink -f ../..)" && \ - ver="#define WIREGUARD_VERSION \"$$(git describe --dirty 2>/dev/null)\"" && \ - [ "$$(cat version.h 2>/dev/null)" != "$$ver" ] && \ - echo "$$ver" > version.h && \ - git update-index --assume-unchanged version.h || true - -dkms.conf: - @export GIT_CEILING_DIRECTORIES="$$(readlink -f ../..)" && \ - ver="$$(git describe --dirty 2>/dev/null)" && \ - . ./dkms.conf && \ - [ "$$PACKAGE_VERSION" != "$$ver" ] && \ - sed -i "s/PACKAGE_VERSION=.*/PACKAGE_VERSION=\"$$ver\"/" dkms.conf && \ - git update-index --assume-unchanged dkms.conf || true - -module: version.h - @$(MAKE) -C $(KERNELDIR) M=$(PWD) modules - -module-debug: version.h - @$(MAKE) -C $(KERNELDIR) M=$(PWD) V=1 CONFIG_WIREGUARD_DEBUG=y modules +WIREGUARD_VERSION = $(patsubst v%,%,$(shell GIT_CEILING_DIRECTORIES="$(PWD)/../.." git describe --dirty 2>/dev/null)) + +module: + @$(MAKE) -C $(KERNELDIR) M=$(PWD) WIREGUARD_VERSION="$(WIREGUARD_VERSION)" modules + +module-debug: + @$(MAKE) -C $(KERNELDIR) M=$(PWD) V=1 CONFIG_WIREGUARD_DEBUG=y WIREGUARD_VERSION="$(WIREGUARD_VERSION)" modules clean: @$(MAKE) -C $(KERNELDIR) M=$(PWD) clean module-install: - @$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install + @$(MAKE) -C $(KERNELDIR) M=$(PWD) WIREGUARD_VERSION="$(WIREGUARD_VERSION)" modules_install $(DEPMOD) -a $(KERNELRELEASE) install: module-install @@ -68,4 +55,4 @@ cloc: -include tests/debug.mk -.PHONY: all module module-debug module-install install dkms-install clean cloc check style version.h dkms.conf +.PHONY: all module module-debug module-install install dkms-install clean cloc check style |