xref: /OK3568_Linux_fs/kernel/drivers/hwtracing/coresight/mali/Kbuild (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1# SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
2#
3# (C) COPYRIGHT 2022 ARM Limited. All rights reserved.
4#
5# This program is free software and is provided to you under the terms of the
6# GNU General Public License version 2 as published by the Free Software
7# Foundation, and any use by you of this program is subject to the terms
8# of such GNU license.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, you can access it online at
17# http://www.gnu.org/licenses/gpl-2.0.html.
18#
19#
20
21# make $(src) as absolute path if it is not already, by prefixing $(srctree)
22# This is to prevent any build issue due to wrong path.
23src:=$(if $(patsubst /%,,$(src)),$(srctree)/$(src),$(src))
24
25#
26# ccflags
27#
28ccflags-y += \
29    -I$(srctree)/include/linux \
30    -I$(src) \
31    -I$(srctree)/drivers/hwtracing/coresight/ \
32    -I$(src)/../../../../include
33
34subdir-ccflags-y += $(ccflags-y)
35
36ifneq ($(CONFIG_CORESIGHT), n)
37ifneq ($(CONFIG_CORESIGHT), )
38
39
40ifeq ($(CONFIG_CORESIGHT_MALI_SOURCES_ETM),y)
41    obj-m += coresight_mali_source_etm.o
42    coresight_mali_source_etm-y := \
43        sources/etm/coresight_mali_source_etm_core.o \
44        sources/coresight_mali_sources.o \
45        coresight_mali_common.o
46endif
47
48ifeq ($(CONFIG_CORESIGHT_MALI_SOURCES_ITM),y)
49    obj-m += coresight_mali_source_itm.o
50    coresight_mali_source_itm-y := \
51        sources/itm/coresight_mali_source_itm_core.o \
52        sources/coresight_mali_sources.o \
53        coresight_mali_common.o
54endif
55
56ifeq ($(CONFIG_CORESIGHT_MALI_SOURCES_ELA),y)
57    obj-m += coresight_mali_source_ela.o
58    coresight_mali_source_ela-y := \
59        sources/ela/coresight_mali_source_ela_core.o \
60        sources/coresight_mali_sources.o \
61        coresight_mali_common.o
62endif
63
64endif
65endif
66