blob: 4c38f2a070459de571f3920577469672d960191c [file] [log] [blame]
Googler268e4302021-03-30 16:05:54 +08001#
2# (C) COPYRIGHT 2010-2018 ARM Limited. All rights reserved.
3#
4# This program is free software and is provided to you under the terms of the
5# GNU General Public License version 2 as published by the Free Software
6# Foundation, and any use by you of this program is subject to the terms
7# of such GNU licence.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program; if not, you can access it online at
16# http://www.gnu.org/licenses/gpl-2.0.html.
17#
18# SPDX-License-Identifier: GPL-2.0
19#
20#
21
22import sys
23Import('env')
24
25SConscript( 'tests/sconscript' )
26
27mock_test = 0
28
29# Source files required for kbase.
30kbase_src = [
31 Glob('*.c'),
32 Glob('backend/*/*.c'),
33 Glob('internal/*/*.c'),
34 Glob('ipa/*.c'),
35 Glob('platform/%s/*.c' % env['platform_config']),
36 Glob('thirdparty/*.c'),
37]
38
39if env['platform_config']=='juno_soc':
40 kbase_src += [Glob('platform/devicetree/*.c')]
41else:
42 kbase_src += [Glob('platform/%s/*.c' % env['platform_config'])]
43
44if Glob('#kernel/drivers/gpu/arm/midgard/tests/internal/src/mock') and env['unit'] == '1':
45 kbase_src += [Glob('#kernel/drivers/gpu/arm/midgard/tests/internal/src/mock/*.c')]
46 mock_test = 1
47
48make_args = env.kernel_get_config_defines(ret_list = True) + [
49 'PLATFORM=%s' % env['platform'],
50 'MALI_KERNEL_TEST_API=%s' % env['debug'],
51 'MALI_UNIT_TEST=%s' % env['unit'],
52 'MALI_RELEASE_NAME=%s' % env['mali_release_name'],
53 'MALI_MOCK_TEST=%s' % mock_test,
54 'MALI_CUSTOMER_RELEASE=%s' % env['release'],
55 'MALI_COVERAGE=%s' % env['coverage'],
56]
57
58kbase = env.BuildKernelModule('$STATIC_LIB_PATH/mali_kbase.ko', kbase_src,
59 make_args = make_args)
60
61if 'smc_protected_mode_switcher' in env:
62 env.Depends('$STATIC_LIB_PATH/mali_kbase.ko', '$STATIC_LIB_PATH/smc_protected_mode_switcher.ko')
63
64env.KernelObjTarget('kbase', kbase)
65
66env.AppendUnique(BASE=['cutils_linked_list'])