Commit | Line | Data |
---|---|---|
b7cdc182 | 1 | # SPDX-License-Identifier: (GPL-2.0-only OR LGPL-2.1-only) |
6c27a5cc | 2 | |
7b25fa17 MJ |
3 | ccflags-y += -DLTTNG_LINUX_MAJOR=$(VERSION) |
4 | ccflags-y += -DLTTNG_LINUX_MINOR=$(PATCHLEVEL) | |
5 | ccflags-y += -DLTTNG_LINUX_PATCH=$(SUBLEVEL) | |
6 | ||
72e6c528 MD |
7 | # Work-around for distro-specific public modules ABI breakages. |
8 | # Some distributions break the public module instrumentation ABI | |
9 | # compared to upstream stable kernels without providing other mean than | |
10 | # the kernel EXTRAVERSION to figure it out. Translate this information | |
11 | # into a define visible from the C preprocessor. | |
12 | ||
6c27a5cc | 13 | DEB_API_VERSION:=$(shell $(TOP_LTTNG_MODULES_DIR)/scripts/abi-debian-version.sh $(CURDIR)) |
72e6c528 MD |
14 | |
15 | ifneq ($(DEB_API_VERSION), 0) | |
a8907e9a | 16 | ccflags-y += -DDEBIAN_API_VERSION=$(DEB_API_VERSION) |
72e6c528 | 17 | endif |
b4c8e4d3 | 18 | |
6c27a5cc | 19 | RHEL_API_VERSION:=$(shell $(TOP_LTTNG_MODULES_DIR)/scripts/abi-rhel-version.sh $(CURDIR)) |
c94ac1ac MJ |
20 | |
21 | ifneq ($(RHEL_API_VERSION), 0) | |
22 | ccflags-y += -DRHEL_API_VERSION=$(RHEL_API_VERSION) | |
23 | endif | |
24 | ||
6c27a5cc | 25 | SLE_API_VERSION:=$(shell $(TOP_LTTNG_MODULES_DIR)/scripts/abi-sle-version.sh $(CURDIR)) |
ce66b486 MJ |
26 | |
27 | ifneq ($(SLE_API_VERSION), 0) | |
28 | ccflags-y += -DSLE_API_VERSION=$(SLE_API_VERSION) | |
29 | endif | |
30 | ||
6c27a5cc | 31 | FEDORA_REVISION_VERSION:=$(shell $(TOP_LTTNG_MODULES_DIR)/scripts/abi-fedora-version.sh $(CURDIR)) |
e4838da1 LG |
32 | |
33 | ifneq ($(FEDORA_REVISION_VERSION), 0) | |
34 | ccflags-y += -DFEDORA_REVISION_VERSION=$(FEDORA_REVISION_VERSION) | |
35 | endif | |
36 | ||
6c27a5cc | 37 | RT_PATCH_VERSION:=$(shell $(TOP_LTTNG_MODULES_DIR)/scripts/rt-patch-version.sh $(CURDIR)) |
b4c8e4d3 MJ |
38 | |
39 | ifneq ($(RT_PATCH_VERSION), 0) | |
40 | ccflags-y += -DRT_PATCH_VERSION=$(RT_PATCH_VERSION) | |
41 | endif | |
f61d99f9 | 42 | |
6c27a5cc | 43 | EXTRA_VERSION_NAME:=$(shell $(TOP_LTTNG_MODULES_DIR)/scripts/extra-version-name.sh $(TOP_LTTNG_MODULES_DIR)) |
101215b7 MJ |
44 | |
45 | ifneq ($(EXTRA_VERSION_NAME), 0) | |
46 | ccflags-y += -DLTTNG_EXTRA_VERSION_NAME='"$(EXTRA_VERSION_NAME)"' | |
47 | endif | |
48 | ||
6c27a5cc | 49 | EXTRA_VERSION_GIT:=$(shell $(TOP_LTTNG_MODULES_DIR)/scripts/extra-version-git.sh $(TOP_LTTNG_MODULES_DIR)) |
101215b7 MJ |
50 | |
51 | ifneq ($(EXTRA_VERSION_GIT), 0) | |
52 | ccflags-y += -DLTTNG_EXTRA_VERSION_GIT='"$(EXTRA_VERSION_GIT)"' | |
53 | endif | |
54 | ||
6c27a5cc | 55 | EXTRA_VERSION_PATCHES:=$(shell $(TOP_LTTNG_MODULES_DIR)/scripts/extra-version-patches.sh $(TOP_LTTNG_MODULES_DIR)) |
101215b7 | 56 | |
a6cf40a4 MJ |
57 | mnt_ns_dep = $(srctree)/fs/mount.h |
58 | ifeq ($(wildcard $(mnt_ns_dep)),) | |
59 | ccflags-y += -DLTTNG_MNT_NS_MISSING_HEADER | |
60 | endif | |
61 | ||
e6213a91 | 62 | # vim:syntax=make |