forked from LineageOS/android_device_lge_msm8996-common
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-makefiles.sh
executable file
·80 lines (63 loc) · 1.92 KB
/
setup-makefiles.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2020 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
set -e
export G5_DEVICE_LIST="g5 h830 h850 rs988"
export V20_DEVICE_LIST="v20 h910 h915 h918 h990 vs995 us996 ls997"
export G6_DEVICE_LIST="g6 h870 h872 us997"
# Load extract_utils and do some sanity checks
MY_DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$MY_DIR" ]]; then MY_DIR="$PWD"; fi
ANDROID_ROOT="$MY_DIR"/../../..
HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
if [ ! -f "$HELPER" ]; then
echo "Unable to find helper script at $HELPER"
exit 1
fi
. "$HELPER"
# Initialize the helper for common platform
setup_vendor "$PLATFORM_COMMON" "$VENDOR" "$ANDROID_ROOT" true
# Copyright headers and common guards
BKP_DEVICE_COMMON="$DEVICE_COMMON"
DEVICE_COMMON="$PLATFORM_COMMON"
write_headers "$G5_DEVICE_LIST $V20_DEVICE_LIST $G6_DEVICE_LIST"
DEVICE_COMMON="$BKP_DEVICE_COMMON"
# The standard blobs
write_makefiles "$MY_DIR"/proprietary-files.txt true
write_makefiles "$MY_DIR"/proprietary-files-qc.txt true
# We are done with platform
write_footers
# Reinitialize the helper for common device
setup_vendor "$DEVICE_COMMON" "$VENDOR" "$ANDROID_ROOT" true
# Copyright headers and guards
case "$DEVICE_COMMON" in
g5-common)
write_headers "$G5_DEVICE_LIST"
;;
g6-common)
write_headers "$G6_DEVICE_LIST"
;;
v20-common)
write_headers "$V20_DEVICE_LIST"
;;
*)
printf 'Unknown device common: "%s"\n' "$DEVICE_COMMON"
exit 1
;;
esac
write_makefiles "$MY_DIR/../$DEVICE_COMMON/proprietary-files.txt" true
# We are done with common
write_footers
# Reinitialize the helper for device
setup_vendor "$DEVICE" "$VENDOR" "$ANDROID_ROOT"
# Copyright headers and guards
write_headers
# Device specific blobs
write_makefiles "$MY_DIR/../$DEVICE/proprietary-files.txt" true
write_makefiles "$MY_DIR/../$DEVICE/proprietary-files-qc.txt" true
# We are done with device
write_footers