From fc5f0f1e2782b5d376e8fbe05c4505ec56c6e982 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 1 Oct 2014 12:05:41 -0400 Subject: [PATCH] Check for stale version.h files Signed-off-by: Mathieu Desnoyers --- Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Makefile b/Makefile index 606b5ec8..aa4835d3 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,20 @@ ifneq ($(KERNELRELEASE),) ifneq ($(CONFIG_TRACEPOINTS),) +lttng_check_linux_version = $(shell pwd)/include/linux/version.h +lttng_check_generated_linux_version = $(shell pwd)/include/generated/uapi/linux/version.h + +# +# Check for stale version.h, which can be a leftover from an old Linux +# kernel tree moved to a newer kernel version, only pruned by make +# distclean. +# +ifneq ($(wildcard $(lttng_check_linux_version)),) +ifneq ($(wildcard $(lttng_check_generated_linux_version)),) +$(error Duplicate version.h files found in $(lttng_check_linux_version) and $(lttng_check_generated_linux_version). Consider running make distclean on your kernel, or removing the stale $(lttng_check_linux_version) file) +endif +endif + obj-m += lttng-ring-buffer-client-discard.o obj-m += lttng-ring-buffer-client-overwrite.o obj-m += lttng-ring-buffer-metadata-client.o -- 2.39.5