c39a84a0cfb7a2288c4b2ba323c3770530a29a22
[lttng-modules.git] / probes / Makefile
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 obj-m += lttng-probe-sched.o
13 obj-m += lttng-probe-irq.o
14 obj-m += lttng-probe-timer.o
15 obj-m += lttng-probe-kmem.o
16 obj-m += lttng-probe-module.o
17 obj-m += lttng-probe-power.o
18
19 obj-m += lttng-probe-statedump.o
20
21 ifneq ($(CONFIG_KVM),)
22 obj-m += lttng-probe-kvm.o
23 endif
24
25 obj-m += $(shell \
26 if [ $(VERSION) -ge 3 \
27 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 35 \) ] ; then \
28 echo "lttng-probe-signal.o" ; fi;)
29
30 ifneq ($(CONFIG_BLOCK),)
31 ifneq ($(CONFIG_EVENT_TRACING),) # need blk_cmd_buf_len
32 obj-m += $(shell \
33 if [ $(VERSION) -ge 3 \
34 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 38 \) ] ; then \
35 echo "lttng-probe-block.o" ; fi;)
36 endif
37 endif
38
39 ifneq ($(CONFIG_NET),)
40 obj-m += lttng-probe-net.o
41 obj-m += lttng-probe-napi.o
42 obj-m += lttng-probe-skb.o
43 obj-m += $(shell \
44 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 1 ] ; then \
45 echo "lttng-probe-sock.o" ; fi;)
46 obj-m += $(shell \
47 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 1 ] ; then \
48 echo "lttng-probe-udp.o" ; fi;)
49 endif
50
51 ifneq ($(CONFIG_SND_SOC),)
52 obj-m += $(shell \
53 if [ $(VERSION) -ge 3 \
54 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 38 \) ] ; then \
55 echo "lttng-probe-asoc.o" ; fi;)
56 endif
57
58 ifneq ($(CONFIG_EXT3_FS),)
59 obj-m += $(shell \
60 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 1 ] ; then \
61 echo "lttng-probe-ext3.o" ; fi;)
62 endif
63
64 ifneq ($(CONFIG_GPIOLIB),)
65 obj-m += $(shell \
66 if [ $(VERSION) -ge 3 ] ; then \
67 echo "lttng-probe-gpio.o" ; fi;)
68 endif
69
70 ifneq ($(CONFIG_JBD2),)
71 obj-m += lttng-probe-jbd2.o
72 endif
73
74 ifneq ($(CONFIG_JBD),)
75 obj-m += $(shell \
76 if [ $(VERSION) -ge 3 -a $(PATCHLEVEL) -ge 1 ] ; then \
77 echo "lttng-probe-jbd.o" ; fi;)
78 endif
79
80 ifneq ($(CONFIG_REGULATOR),)
81 obj-m += $(shell \
82 if [ $(VERSION) -ge 3 \
83 -o \( $(VERSION) -eq 2 -a $(PATCHLEVEL) -ge 6 -a $(SUBLEVEL) -ge 38 \) ] ; then \
84 echo "lttng-probe-regulator.o" ; fi;)
85 endif
86
87 ifneq ($(CONFIG_SCSI),)
88 obj-m += $(shell \
89 if [ $(VERSION) -ge 3 ] ; then \
90 echo "lttng-probe-scsi.o" ; fi;)
91 endif
92
93 vmscan = $(shell \
94 if [ $(VERSION) -ge 3 ] ; then \
95 echo "lttng-probe-vmscan.o" ; fi;)
96 ifneq ($(CONFIG_SWAP),)
97 obj-m += $(vmscan)
98 else
99 ifneq ($(CONFIG_CGROUP_MEM_RES_CTLR),)
100 obj-m += $(vmscan)
101 endif
102 endif
103
104 ifneq ($(CONFIG_LOCKDEP),)
105 obj-m += lttng-probe-lock.o
106 endif
107
108 ifneq ($(CONFIG_KPROBES),)
109 obj-m += lttng-kprobes.o
110 endif
111
112
113 ifneq ($(CONFIG_KRETPROBES),)
114 obj-m += lttng-kretprobes.o
115 endif
116
117 ifneq ($(CONFIG_DYNAMIC_FTRACE),)
118 obj-m += lttng-ftrace.o
119 endif
120
121 endif
122
123 else
124 KERNELDIR ?= /lib/modules/$(shell uname -r)/build
125 PWD := $(shell pwd)
126 CFLAGS = $(EXTCFLAGS)
127
128 default:
129 $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
130
131 modules_install:
132 $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
133 /sbin/depmod -a
134
135 clean:
136 $(MAKE) -C $(KERNELDIR) M=$(PWD) clean
137
138 endif
This page took 0.044104 seconds and 4 git commands to generate.