1#
2# Copyright (C) 2016 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
17# Rules to generate setup script for device perf tests
18# Different devices may share the same script. To add a new script, define a
19# new variable named <device name>_script, pointing at the script in current
20# source folder.
21# At execution time, scripts will be pushed onto device and run with root
22# identity
23
24LOCAL_PATH:= $(call my-dir)
25
26# only define the target if a perf setup script is defined by the BoardConfig
27# of the device we are building.
28#
29# To add a new script:
30# 1. add a new setup script suitable for the device at:
31#    platform_testing/scripts/perf-setup/
32# 2. modify BoardConfig.mk of the corresponding device under:
33#    device/<OEM name>/<device name/
34# 3. add variable "BOARD_PERFSETUP_SCRIPT", and point it at the path to the new
35#    perf setup script; the path should be relative to the build root
36ifeq ($(strip $(BOARD_PERFSETUP_SCRIPT)),)
37perfsetup_script := platform_testing/scripts/perf-setup/empty-setup.sh
38else
39perfsetup_script := $(BOARD_PERFSETUP_SCRIPT)
40endif
41
42include $(CLEAR_VARS)
43LOCAL_MODULE := perf-setup
44LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
45LOCAL_LICENSE_CONDITIONS := notice
46LOCAL_MODULE_CLASS := EXECUTABLES
47LOCAL_MODULE_TAGS := optional
48LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
49LOCAL_MODULE_STEM := perf-setup.sh
50LOCAL_PREBUILT_MODULE_FILE := $(perfsetup_script)
51LOCAL_COMPATIBILITY_SUITE := device-tests
52include $(BUILD_PREBUILT)
53
54perfsetup_script :=
55