Googler | 0bde759 | 2022-05-12 08:34:10 +0000 | [diff] [blame^] | 1 | # |
| 2 | # (C) COPYRIGHT 2010-2017 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 | |
| 22 | import sys |
| 23 | Import('env') |
| 24 | |
| 25 | SConscript( 'tests/sconscript' ) |
| 26 | |
| 27 | mock_test = 0 |
| 28 | |
| 29 | # Source files required for kbase. |
| 30 | kbase_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 | |
| 39 | if env['platform_config']=='juno_soc': |
| 40 | kbase_src += [Glob('platform/devicetree/*.c')] |
| 41 | else: |
| 42 | kbase_src += [Glob('platform/%s/*.c' % env['platform_config'])] |
| 43 | |
| 44 | if 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 | |
| 48 | make_args = env.kernel_get_config_defines(ret_list = True) + [ |
| 49 | 'PLATFORM=%s' % env['platform'], |
| 50 | 'MALI_ERROR_INJECT_ON=%s' % env['error_inject'], |
| 51 | 'MALI_KERNEL_TEST_API=%s' % env['debug'], |
| 52 | 'MALI_UNIT_TEST=%s' % env['unit'], |
| 53 | 'MALI_RELEASE_NAME=%s' % env['mali_release_name'], |
| 54 | 'MALI_MOCK_TEST=%s' % mock_test, |
| 55 | 'MALI_CUSTOMER_RELEASE=%s' % env['release'], |
| 56 | 'MALI_COVERAGE=%s' % env['coverage'], |
| 57 | ] |
| 58 | |
| 59 | kbase = env.BuildKernelModule('$STATIC_LIB_PATH/mali_kbase.ko', kbase_src, |
| 60 | make_args = make_args) |
| 61 | |
| 62 | # need Module.symvers from ump.ko build |
| 63 | if int(env['ump']) == 1: |
| 64 | env.Depends(kbase, '$STATIC_LIB_PATH/ump.ko') |
| 65 | |
| 66 | if 'smc_protected_mode_switcher' in env: |
| 67 | env.Depends('$STATIC_LIB_PATH/mali_kbase.ko', '$STATIC_LIB_PATH/smc_protected_mode_switcher.ko') |
| 68 | |
| 69 | env.KernelObjTarget('kbase', kbase) |
| 70 | |
| 71 | env.AppendUnique(BASE=['cutils_linked_list']) |