| 1 | # |
| 2 | # Makefile for the LTT probes. |
| 3 | # Only build from the package top-level directory. Never use with make directly. |
| 4 | |
| 5 | ifneq ($(KERNELRELEASE),) |
| 6 | ifneq ($(CONFIG_TRACEPOINTS),) |
| 7 | |
| 8 | ccflags-y += -I$(PWD)/probes |
| 9 | obj-m += lttng-types.o |
| 10 | |
| 11 | obj-m += lttng-probe-lttng.o |
| 12 | |
| 13 | obj-m += lttng-probe-sched.o |
| 14 | obj-m += lttng-probe-irq.o |
| 15 | |
| 16 | ifneq ($(CONFIG_HAVE_SYSCALL_TRACEPOINTS),) |
| 17 | obj-m += lttng-probe-syscalls.o |
| 18 | endif |
| 19 | |
| 20 | ifneq ($(CONFIG_KVM),) |
| 21 | obj-m += lttng-probe-kvm.o |
| 22 | endif |
| 23 | |
| 24 | ifneq ($(CONFIG_BLOCK),) |
| 25 | ifneq ($(CONFIG_EVENT_TRACING),) # need blk_cmd_buf_len |
| 26 | obj-m += lttng-probe-block.o |
| 27 | endif |
| 28 | endif |
| 29 | |
| 30 | ifneq ($(CONFIG_KPROBES),) |
| 31 | obj-m += lttng-kprobes.o |
| 32 | endif |
| 33 | |
| 34 | ifneq ($(CONFIG_DYNAMIC_FTRACE),) |
| 35 | obj-m += lttng-ftrace.o |
| 36 | endif |
| 37 | |
| 38 | endif |
| 39 | |
| 40 | else |
| 41 | KERNELDIR ?= /lib/modules/$(shell uname -r)/build |
| 42 | PWD := $(shell pwd) |
| 43 | CFLAGS = $(EXTCFLAGS) |
| 44 | |
| 45 | default: |
| 46 | $(MAKE) -C $(KERNELDIR) M=$(PWD) modules |
| 47 | |
| 48 | modules_install: |
| 49 | $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install |
| 50 | /sbin/depmod -a |
| 51 | |
| 52 | clean: |
| 53 | $(MAKE) -C $(KERNELDIR) M=$(PWD) clean |
| 54 | |
| 55 | endif |