Fix: Always build vmscan probe
[lttng-modules.git] / Makefile
index 588ca960bf00ce96c840c964a50b52a738b95bf4..93ad9e7ddf736b9cf4af498eddc1bf574af94287 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -7,9 +7,11 @@ ifneq ($(KERNELRELEASE),)
   # This part of the Makefile is used when called by the kernel build system
   # and defines the modules to be built.
 
-  ifeq ($(CONFIG_TRACEPOINTS),)
-    $(error The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration)
-  endif # CONFIG_TRACEPOINTS
+  ifdef CONFIG_LOCALVERSION    # Check if dot-config is included.
+    ifeq ($(CONFIG_TRACEPOINTS),)
+      $(error The option CONFIG_TRACEPOINTS needs to be enabled in your kernel configuration)
+    endif # CONFIG_TRACEPOINTS
+  endif # ifdef CONFIG_LOCALVERSION
 
   TOP_LTTNG_MODULES_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))
 
@@ -27,6 +29,13 @@ ifneq ($(KERNELRELEASE),)
     endif
   endif
 
+  ifneq ($(shell \
+    if [ $(VERSION) -ge 5 \
+      -o \( $(VERSION) -eq 4 -a $(PATCHLEVEL) -ge 10 \) ] ; then \
+      echo "true" ; fi;),)
+    $(warning You are entering uncharted territories adventurer! Proceed with utmost caution (also, lttng-modules 2.8 does not support Linux >= 4.10. You should upgrade to a newer lttng-modules version.))
+  endif
+
   include $(TOP_LTTNG_MODULES_DIR)/Makefile.ABI.workarounds
 
   ccflags-y += -I$(TOP_LTTNG_MODULES_DIR)
@@ -90,6 +99,7 @@ ifneq ($(KERNELRELEASE),)
 
   obj-$(CONFIG_LTTNG) += probes/
   obj-$(CONFIG_LTTNG) += lib/
+  obj-$(CONFIG_LTTNG) += tests/
 
 else # KERNELRELEASE
 
@@ -101,16 +111,18 @@ KERNELDIR ?= /lib/modules/$(shell uname -r)/build
 PWD := $(shell pwd)
 CFLAGS = $(EXTCFLAGS)
 
-default:
-       $(MAKE) -C $(KERNELDIR) M=$(PWD) CONFIG_LTTNG=m modules
+default: modules
+
+modules:
+       $(MAKE) -C $(KERNELDIR) M=$(PWD) CONFIG_LTTNG=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST=m modules
 
 modules_install:
-       $(MAKE) -C $(KERNELDIR) M=$(PWD) CONFIG_LTTNG=m modules_install
+       $(MAKE) -C $(KERNELDIR) M=$(PWD) CONFIG_LTTNG=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST=m modules_install
 
 clean:
        $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
 
 %.i: %.c
-       $(MAKE) -C $(KERNELDIR) M=$(PWD) CONFIG_LTTNG=m $@
+       $(MAKE) -C $(KERNELDIR) M=$(PWD) CONFIG_LTTNG=m CONFIG_LTTNG_CLOCK_PLUGIN_TEST=m $@
 
 endif # KERNELRELEASE
This page took 0.023322 seconds and 4 git commands to generate.